summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-07-11 15:36:38 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-07-15 11:37:07 +0200
commit5a3063968c21be4522f3cc5bfd9d1471cc4d57c2 (patch)
treea6930edf0ec7ba9316e4cc151c684396e5989eeb /tools
parent62ef1132ae0775dae628b45f2642c25b19b740a5 (diff)
Make the marker and the find function class members.
Prepare for QTIFW-292 and QTIFW-345. Change-Id: I065366742d28e72bc5ae55e70eabf6532b809fea Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/binarycreator/binarycreator.cpp4
-rw-r--r--tools/devtool/binaryreplace.cpp8
-rw-r--r--tools/devtool/main.cpp10
3 files changed, 13 insertions, 9 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp
index 96825bf49..a50ff7a45 100644
--- a/tools/binarycreator/binarycreator.cpp
+++ b/tools/binarycreator/binarycreator.cpp
@@ -332,8 +332,8 @@ static int assemble(Input input, const QInstaller::Settings &settings)
//data block size, from end of .exe to end of file
QInstaller::appendInt64(&out, out.pos() + 3 * sizeof(qint64) -dataBlockStart);
- QInstaller::appendInt64(&out, QInstaller::MagicInstallerMarker);
- QInstaller::appendInt64(&out, QInstaller::MagicCookie);
+ QInstaller::appendInt64(&out, BinaryContent::MagicInstallerMarker);
+ QInstaller::appendInt64(&out, BinaryContent::MagicCookie);
} catch (const Error &e) {
qCritical("Error occurred while assembling the installer: %s", qPrintable(e.message()));
diff --git a/tools/devtool/binaryreplace.cpp b/tools/devtool/binaryreplace.cpp
index 1e832dcfc..f170059f7 100644
--- a/tools/devtool/binaryreplace.cpp
+++ b/tools/devtool/binaryreplace.cpp
@@ -113,7 +113,7 @@ int BinaryReplace::replace(const QString &source, const QString &target)
QInstaller::openForAppend(&installerBaseNew);
installerBaseNew.seek(installerBaseNew.size());
- if (m_binaryLayout.magicMarker == QInstaller::MagicInstallerMarker) {
+ if (m_binaryLayout.magicMarker == QInstaller::BinaryContent::MagicInstallerMarker) {
QInstaller::openForRead(&installerBaseOld);
installerBaseOld.seek(m_binaryLayout.metadataResourceSegments.first().start());
QInstaller::appendData(&installerBaseNew, &installerBaseOld, installerBaseOld
@@ -122,8 +122,10 @@ int BinaryReplace::replace(const QString &source, const QString &target)
} else {
QInstaller::appendInt64(&installerBaseNew, 0);
QInstaller::appendInt64(&installerBaseNew, 4 * sizeof(qint64));
- QInstaller::appendInt64(&installerBaseNew, QInstaller::MagicUninstallerMarker);
- QInstaller::appendInt64(&installerBaseNew, QInstaller::MagicCookie);
+ QInstaller::appendInt64(&installerBaseNew,
+ QInstaller::BinaryContent::MagicUninstallerMarker);
+ QInstaller::appendInt64(&installerBaseNew,
+ QInstaller::BinaryContent::MagicCookie);
}
installerBaseNew.close();
#else
diff --git a/tools/devtool/main.cpp b/tools/devtool/main.cpp
index 713b0e02b..b03bc4ff1 100644
--- a/tools/devtool/main.cpp
+++ b/tools/devtool/main.cpp
@@ -106,17 +106,19 @@ int main(int argc, char *argv[])
try {
QFile *file = new QFile(path);
QInstaller::openForRead(file);
- qint64 pos = QInstaller::findMagicCookie(file, QInstaller::MagicCookie);
+ qint64 pos = QInstaller::BinaryContent::findMagicCookie(file,
+ QInstaller::BinaryContent::MagicCookie);
QInstaller::BinaryLayout layout = QInstaller::BinaryContent::readBinaryLayout(file, pos);
- if (layout.magicMarker == QInstaller::MagicUninstallerMarker) {
+ if (layout.magicMarker == QInstaller::BinaryContent::MagicUninstallerMarker) {
QFileInfo fi(path);
if (QInstaller::isInBundle(fi.absoluteFilePath(), &bundlePath))
fi.setFile(bundlePath);
path = fi.absolutePath() + QLatin1Char('/') + fi.baseName() + QLatin1String(".dat");
file->setFileName(path);
- pos = QInstaller::findMagicCookie(file, QInstaller::MagicCookie);
+ pos = QInstaller::BinaryContent::findMagicCookie(file,
+ QInstaller::BinaryContent::MagicCookie);
layout = QInstaller::BinaryContent::readBinaryLayout(file, pos);
}
@@ -181,7 +183,7 @@ int main(int argc, char *argv[])
if (parser.isSet(dump)) {
// To dump the content we do not need the binary format engine.
- if (layout.magicMarker != QInstaller::MagicInstallerMarker)
+ if (layout.magicMarker != QInstaller::BinaryContent::MagicInstallerMarker)
throw QInstaller::Error(QLatin1String("Source file is not an installer."));
BinaryDump bd;
return bd.dump(index, parser.value(dump));