diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-08-29 12:56:06 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-09-04 10:41:53 +0200 |
commit | 77b1e168202e8781ddfe5c06fc1ceaea5934e855 (patch) | |
tree | ffcd3040a42ffd5086b34a034d042b0d65143aa3 /src/libs/installer/packagemanagercore_p.cpp | |
parent | e9e26f11d78def8ad8cb8f1864c61d88e3a1f0be (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 'src/libs/installer/packagemanagercore_p.cpp')
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index b2d7d7d83..c9cd458a6 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -203,7 +203,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core) } PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, qint64 magicInstallerMaker, - const OperationList &performedOperations) + const QList<OperationBlob> &performedOperations) : m_updateFinder(0) , m_updaterApplication(new DummyConfigurationInterface) , m_status(PackageManagerCore::Unfinished) @@ -212,7 +212,6 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q , m_launchedAsRoot(AdminAuthorization::hasAdminRights()) , m_completeUninstall(false) , m_needToWriteMaintenanceTool(false) - , m_performedOperationsOld(performedOperations) , m_dependsOnLocalInstallerBinary(false) , m_core(core) , m_updates(false) @@ -228,6 +227,22 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q , m_guiObject(0) , m_remoteFileEngineHandler(new RemoteFileEngineHandler) { + foreach (const OperationBlob &operation, performedOperations) { + QScopedPointer<QInstaller::Operation> op(KDUpdater::UpdateOperationFactory::instance() + .create(operation.name)); + if (op.isNull()) { + qWarning() << QString::fromLatin1("Failed to load unknown operation %1") + .arg(operation.name); + continue; + } + + if (!op->fromXml(operation.xml)) { + qWarning() << "Failed to load XML for operation:" << operation.name; + continue; + } + m_performedOperationsOld.append(op.take()); + } + // Creates and initializes a remote client, makes us get admin rights for QFile, QSettings // and QProcess operations. Init needs to called before we can get the real authorization key. int port = 30000 + qrand() % 1000; |