diff options
Diffstat (limited to 'src/libs/installer/fakestopprocessforupdateoperation.cpp')
-rw-r--r-- | src/libs/installer/fakestopprocessforupdateoperation.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/libs/installer/fakestopprocessforupdateoperation.cpp b/src/libs/installer/fakestopprocessforupdateoperation.cpp index 2d49d0f46..d03319491 100644 --- a/src/libs/installer/fakestopprocessforupdateoperation.cpp +++ b/src/libs/installer/fakestopprocessforupdateoperation.cpp @@ -39,7 +39,8 @@ using namespace KDUpdater; using namespace QInstaller; -FakeStopProcessForUpdateOperation::FakeStopProcessForUpdateOperation() +FakeStopProcessForUpdateOperation::FakeStopProcessForUpdateOperation(PackageManagerCore *core) + : UpdateOperation(core) { setName(QLatin1String("FakeStopProcessForUpdate")); } @@ -56,15 +57,12 @@ bool FakeStopProcessForUpdateOperation::performOperation() bool FakeStopProcessForUpdateOperation::undoOperation() { setError(KDUpdater::UpdateOperation::NoError); - if (arguments().size() != 1) { - setError(KDUpdater::UpdateOperation::InvalidArguments, tr("Number of arguments does not " - "match: one is required")); + if (!checkArgumentCount(1)) return false; - } - PackageManagerCore *const core = value(QLatin1String("installer")).value<PackageManagerCore*>(); + PackageManagerCore *const core = packageManager(); if (!core) { - setError(KDUpdater::UpdateOperation::UserDefinedError, tr("Could not get package manager " + setError(KDUpdater::UpdateOperation::UserDefinedError, tr("Cannot get package manager " "core.")); return false; } @@ -93,8 +91,3 @@ bool FakeStopProcessForUpdateOperation::testOperation() { return true; } - -Operation *FakeStopProcessForUpdateOperation::clone() const -{ - return new FakeStopProcessForUpdateOperation(); -} |