diff options
author | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-05-06 15:23:53 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-05-06 19:55:51 +0000 |
commit | 478a8a1db3eed2c41d46da966003cc1722bd347d (patch) | |
tree | a9d7bcbdbd91332101ee85a2b44c4a76f85bd5ab /src/libs/installer/component.cpp | |
parent | a6fdda83c338357b848fe710274949917c58768f (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/component.cpp')
-rw-r--r-- | src/libs/installer/component.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 43ad5031e..090bfa501 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -901,15 +901,14 @@ OperationList Component::operations() const if (!d->m_minimumProgressOperation) { d->m_minimumProgressOperation = KDUpdater::UpdateOperationFactory::instance() - .create(QLatin1String("MinimumProgress")); + .create(QLatin1String("MinimumProgress"), d->m_core); d->m_minimumProgressOperation->setValue(QLatin1String("component"), name()); d->m_operations.append(d->m_minimumProgressOperation); } if (!d->m_licenses.isEmpty()) { d->m_licenseOperation = KDUpdater::UpdateOperationFactory::instance() - .create(QLatin1String("License")); - d->m_licenseOperation->setValue(QLatin1String("installer"), QVariant::fromValue(d->m_core)); + .create(QLatin1String("License"), d->m_core); d->m_licenseOperation->setValue(QLatin1String("component"), name()); QVariantMap licenses; @@ -983,7 +982,8 @@ Operation *Component::createOperation(const QString &operationName, const QStrin Operation *Component::createOperation(const QString &operationName, const QStringList ¶meters) { - Operation *operation = KDUpdater::UpdateOperationFactory::instance().create(operationName); + Operation *operation = KDUpdater::UpdateOperationFactory::instance().create(operationName, + d->m_core); if (operation == 0) { const QMessageBox::StandardButton button = MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), @@ -996,7 +996,6 @@ Operation *Component::createOperation(const QString &operationName, const QStrin if (operation->name() == QLatin1String("Delete")) operation->setValue(QLatin1String("performUndo"), false); - operation->setValue(QLatin1String("installer"), qVariantFromValue(d->m_core)); operation->setArguments(d->m_core->replaceVariables(parameters)); operation->setValue(QLatin1String("component"), name()); |