summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore_p.cpp
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@theqtcompany.com>2015-05-06 15:23:53 +0200
committerKarsten Heimrich <karsten.heimrich@theqtcompany.com>2015-05-06 19:55:51 +0000
commit478a8a1db3eed2c41d46da966003cc1722bd347d (patch)
treea9d7bcbdbd91332101ee85a2b44c4a76f85bd5ab /src/libs/installer/packagemanagercore_p.cpp
parenta6fdda83c338357b848fe710274949917c58768f (diff)
Remove pseudo static core instance, fixes autotests.
We need the core engine in operations anyway, so pass the pointer to the create function instead of setting it on our own after the operation was created. The only reason to introduce the static was the ~UpdateOperation() destructor, which now can get the value from its internal data instead of using the static instance call. Change-Id: Ide27542837355ec8c642a6687ca02977983f84fa Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/packagemanagercore_p.cpp')
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 0295454d6..7ef25a36c 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -233,7 +233,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q
{
foreach (const OperationBlob &operation, performedOperations) {
QScopedPointer<QInstaller::Operation> op(KDUpdater::UpdateOperationFactory::instance()
- .create(operation.name));
+ .create(operation.name, core));
if (op.isNull()) {
qWarning() << QString::fromLatin1("Failed to load unknown operation %1")
.arg(operation.name);
@@ -551,9 +551,6 @@ void PackageManagerCorePrivate::initialize(const QHash<QString, QString> &params
}
processFilesForDelayedDeletion();
- foreach (Operation *currentOperation, m_performedOperationsOld)
- currentOperation->setValue(QLatin1String("installer"), QVariant::fromValue(m_core));
-
disconnect(this, SIGNAL(installationStarted()), ProgressCoordinator::instance(), SLOT(reset()));
connect(this, SIGNAL(installationStarted()), ProgressCoordinator::instance(), SLOT(reset()));
disconnect(this, SIGNAL(uninstallationStarted()), ProgressCoordinator::instance(), SLOT(reset()));
@@ -649,7 +646,7 @@ QByteArray PackageManagerCorePrivate::replaceVariables(const QByteArray &ba) con
*/
Operation *PackageManagerCorePrivate::createOwnedOperation(const QString &type)
{
- m_ownedOperations.append(KDUpdater::UpdateOperationFactory::instance().create(type));
+ m_ownedOperations.append(KDUpdater::UpdateOperationFactory::instance().create(type, m_core));
return m_ownedOperations.last();
}
@@ -1512,7 +1509,6 @@ bool PackageManagerCorePrivate::runInstaller()
binaryFile = resourcePath.filePath(QLatin1String("installer.dat"));
#endif
createRepo->setValue(QLatin1String("uninstall-only"), true);
- createRepo->setValue(QLatin1String("installer"), QVariant::fromValue(m_core));
createRepo->setArguments(QStringList() << binaryFile << target
+ QLatin1String("/repository"));
@@ -1892,7 +1888,7 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr
if (!component->stopProcessForUpdateRequests().isEmpty()) {
Operation *stopProcessForUpdatesOp = KDUpdater::UpdateOperationFactory::instance()
- .create(QLatin1String("FakeStopProcessForUpdate"));
+ .create(QLatin1String("FakeStopProcessForUpdate"), m_core);
const QStringList arguments(component->stopProcessForUpdateRequests().join(QLatin1String(",")));
stopProcessForUpdatesOp->setArguments(arguments);
addPerformed(stopProcessForUpdatesOp);