From ff60c4cbe2d480923437f1756ea38eefdd865b57 Mon Sep 17 00:00:00 2001 From: kh1 Date: Thu, 8 Sep 2011 15:24:47 +0200 Subject: Remove some superfluous includes. Small style change. Change-Id: Ieecff392a6c219832c3c99c1fbb8f95f0b6d4232 Reviewed-on: http://codereview.qt-project.org/4460 Reviewed-by: Karsten Heimrich --- installerbuilder/libinstaller/operationrunner.cpp | 40 +++++++++++++---------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'installerbuilder/libinstaller/operationrunner.cpp') diff --git a/installerbuilder/libinstaller/operationrunner.cpp b/installerbuilder/libinstaller/operationrunner.cpp index 36c971ce7..ade5e31d3 100644 --- a/installerbuilder/libinstaller/operationrunner.cpp +++ b/installerbuilder/libinstaller/operationrunner.cpp @@ -38,10 +38,13 @@ #include "component.h" #include "init.h" #include "packagemanagercore.h" + #include #include -#include +#include + +#include namespace { class OutputHandler : public QObject @@ -68,12 +71,6 @@ OperationRunner::OperationRunner() OperationRunner::~OperationRunner() { delete m_core; - m_core = 0; -} - -void OperationRunner::setVerbose(bool verbose) -{ - QInstaller::setVerbose(verbose); } bool OperationRunner::init() @@ -92,11 +89,18 @@ bool OperationRunner::init() return true; } +void OperationRunner::setVerbose(bool verbose) +{ + QInstaller::setVerbose(verbose); +} + int OperationRunner::runOperation(const QStringList &arguments) { - if (!init()) - verbose() << "Could not init the packagemanager core - without this not all operations " << - "are working as expected." << std::endl; + if (!init()) { + verbose() << "Could not init the package manager core - without this not all operations " + << "are working as expected." << std::endl; + } + QStringList argumentList = arguments; bool isPerformType = argumentList.contains(QLatin1String("--runoperation")); bool isUndoType = argumentList.contains(QLatin1String("--undooperation")); @@ -111,9 +115,9 @@ int OperationRunner::runOperation(const QStringList &arguments) } try { - QString operationName = argumentList.takeFirst(); - KDUpdater::UpdateOperation* const operation = - KDUpdater::UpdateOperationFactory::instance().create(operationName); + const QString operationName = argumentList.takeFirst(); + KDUpdater::UpdateOperation* const operation = KDUpdater::UpdateOperationFactory::instance() + .create(operationName); if (!operation) { std::cerr << "Can not find the operation: " << qPrintable(operationName) << std::endl; return EXIT_FAILURE; @@ -142,13 +146,13 @@ int OperationRunner::runOperation(const QStringList &arguments) std::cout << "========================================" << std::endl; if (readyPerformed) { - std::cout << "Operation was succesfully performed." << std::endl; + std::cout << "Operation was successfully performed." << std::endl; } else { - std::cerr << "There was a problem while performing the operation: " << - qPrintable(operation->errorString()) << std::endl; + std::cerr << "There was a problem while performing the operation: " + << qPrintable(operation->errorString()) << std::endl; return EXIT_FAILURE; } - } catch (const QInstaller::Error& e) { + } catch (const QInstaller::Error &e) { std::cerr << qPrintable(e.message()) << std::endl; return EXIT_FAILURE; } catch (...) { @@ -156,7 +160,7 @@ int OperationRunner::runOperation(const QStringList &arguments) return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } #include "operationrunner.moc" -- cgit v1.2.3