summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-08-29 12:56:06 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-09-04 10:41:53 +0200
commit77b1e168202e8781ddfe5c06fc1ceaea5934e855 (patch)
treeffcd3040a42ffd5086b34a034d042b0d65143aa3 /tools
parente9e26f11d78def8ad8cb8f1864c61d88e3a1f0be (diff)
Split and implement new installer base, update checker.
Based on the former patches, split the installer base into its own class. Use the new binary content read functions. Adjust uses to match the new classes. Adjust installer base /update checker signature and inheritance. Remove all now superfluous functions from binary content. Core engine instantiates the operations now, makes reading and writing more generic. Move product key check into QInstaller namespace. Make use of the new command line parser. Change-Id: I00aff79085b69ce627906881b43f374681ea7e91 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/devtool/main.cpp15
-rw-r--r--tools/devtool/operationrunner.cpp3
-rw-r--r--tools/devtool/operationrunner.h5
3 files changed, 7 insertions, 16 deletions
diff --git a/tools/devtool/main.cpp b/tools/devtool/main.cpp
index d31870e67..0a9c677d2 100644
--- a/tools/devtool/main.cpp
+++ b/tools/devtool/main.cpp
@@ -143,23 +143,12 @@ int main(int argc, char *argv[])
if (!file->seek(operationsStart))
throw QInstaller::Error(QLatin1String("Could not seek to operation list."));
- QList<QInstaller::Operation *> performedOperations;
+ QList<QInstaller::OperationBlob> performedOperations;
const qint64 operationsCount = QInstaller::retrieveInt64(file);
for (int i = 0; i < operationsCount; ++i) {
const QString name = QInstaller::retrieveString(file);
const QString data = QInstaller::retrieveString(file);
-
- QScopedPointer<QInstaller::Operation> op(KDUpdater::UpdateOperationFactory::instance()
- .create(name));
- if (op.isNull()) {
- throw QInstaller::Error(QString::fromLatin1("Could not load unknown operation %1")
- .arg(name));
- }
- if (!op->fromXml(data)) {
- throw QInstaller::Error(QString::fromLatin1("Could not load XML for operation: %1")
- .arg(name));
- }
- performedOperations.append(op.take());
+ performedOperations.append(QInstaller::OperationBlob(name, data));
}
// seek to the position of the resource collections segment info
diff --git a/tools/devtool/operationrunner.cpp b/tools/devtool/operationrunner.cpp
index 55c1160e2..100dcf2cc 100644
--- a/tools/devtool/operationrunner.cpp
+++ b/tools/devtool/operationrunner.cpp
@@ -49,7 +49,8 @@
#include <iostream>
-OperationRunner::OperationRunner(qint64 magicMarker, const QInstaller::OperationList &oldOperations)
+OperationRunner::OperationRunner(qint64 magicMarker,
+ const QList<QInstaller::OperationBlob> &oldOperations)
: m_core(new QInstaller::PackageManagerCore(magicMarker, oldOperations))
{
// We need a package manager core as some operations expect them to be available.
diff --git a/tools/devtool/operationrunner.h b/tools/devtool/operationrunner.h
index 73964c3a5..d4026dadc 100644
--- a/tools/devtool/operationrunner.h
+++ b/tools/devtool/operationrunner.h
@@ -42,11 +42,12 @@
#ifndef OPERATIONRUNNER_H
#define OPERATIONRUNNER_H
-#include <qinstallerglobal.h>
+#include <binaryformat.h>
#include <QObject>
namespace QInstaller {
+ struct OperationBlob;
class PackageManagerCore;
}
@@ -61,7 +62,7 @@ public:
Undo
};
- OperationRunner(qint64 magicMarker, const QInstaller::OperationList &oldOperations);
+ OperationRunner(qint64 magicMarker, const QList<QInstaller::OperationBlob> &oldOperations);
~OperationRunner();
int runOperation(QStringList arguments, RunMode mode);