diff options
author | hjk <qthjk@ovi.com> | 2011-11-19 14:10:31 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-11-21 13:15:14 +0100 |
commit | 2f9608a18df17db88dd2533b06d0b864e843c934 (patch) | |
tree | a48d646b403d1e3631b09bb0f5e5bcce02e1d2c6 /installerbuilder/libinstaller | |
parent | dfb16001d52da19931d893fa0e09ccdacfc4739d (diff) |
Remaining whitespace, removal of empty destructors etc.
Change-Id: I9f99ae71e832586432d6fc493a701c5d5d074d6a
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder/libinstaller')
83 files changed, 267 insertions, 495 deletions
diff --git a/installerbuilder/libinstaller/addqtcreatorarrayvalueoperation.cpp b/installerbuilder/libinstaller/addqtcreatorarrayvalueoperation.cpp index 1b3babe54..645c76cba 100644 --- a/installerbuilder/libinstaller/addqtcreatorarrayvalueoperation.cpp +++ b/installerbuilder/libinstaller/addqtcreatorarrayvalueoperation.cpp @@ -41,13 +41,9 @@ using namespace QInstaller; -namespace { - QString groupName(const QString &groupName) - { - if (groupName == QLatin1String("General")) - return QString(); - return groupName; - } +static QString groupName(const QString &groupName) +{ + return groupName == QLatin1String("General") ? QString() : groupName; } AddQtCreatorArrayValueOperation::AddQtCreatorArrayValueOperation() @@ -55,10 +51,6 @@ AddQtCreatorArrayValueOperation::AddQtCreatorArrayValueOperation() setName(QLatin1String("AddQtCreatorArrayValue")); } -AddQtCreatorArrayValueOperation::~AddQtCreatorArrayValueOperation() -{ -} - void AddQtCreatorArrayValueOperation::backup() { } diff --git a/installerbuilder/libinstaller/addqtcreatorarrayvalueoperation.h b/installerbuilder/libinstaller/addqtcreatorarrayvalueoperation.h index 72ebaab93..e46de79d6 100644 --- a/installerbuilder/libinstaller/addqtcreatorarrayvalueoperation.h +++ b/installerbuilder/libinstaller/addqtcreatorarrayvalueoperation.h @@ -34,7 +34,6 @@ class AddQtCreatorArrayValueOperation : public Operation { public: AddQtCreatorArrayValueOperation(); - ~AddQtCreatorArrayValueOperation(); void backup(); bool performOperation(); @@ -43,6 +42,6 @@ public: Operation *clone() const; }; -} // namespace +} // namespace QInstaller #endif // ADDQTCREATORVALUEOPERATION_H diff --git a/installerbuilder/libinstaller/adminauthorization.h b/installerbuilder/libinstaller/adminauthorization.h index 9da0b17d9..ff5b53c44 100644 --- a/installerbuilder/libinstaller/adminauthorization.h +++ b/installerbuilder/libinstaller/adminauthorization.h @@ -50,12 +50,11 @@ class AdminAuthorization : public QObject, public AdminAuthorizationBase { Q_OBJECT Q_PROPERTY(bool authorized READ isAuthorized) + public: AdminAuthorization(); - ~AdminAuthorization(); bool execute(QWidget *dialogParent, const QString &programs, const QStringList &arguments); - static bool hasAdminRights(); public Q_SLOTS: @@ -63,10 +62,6 @@ public Q_SLOTS: Q_SIGNALS: void authorized(); - -private: - class Private; - Private *d; }; -#endif +#endif // ADMINAUTHORIZATION_H diff --git a/installerbuilder/libinstaller/adminauthorization_win.cpp b/installerbuilder/libinstaller/adminauthorization_win.cpp index 82a1613fa..7d1e9453b 100644 --- a/installerbuilder/libinstaller/adminauthorization_win.cpp +++ b/installerbuilder/libinstaller/adminauthorization_win.cpp @@ -45,10 +45,6 @@ AdminAuthorization::AdminAuthorization() { } -AdminAuthorization::~AdminAuthorization() -{ -} - bool AdminAuthorization::authorize() { setAuthorized(); diff --git a/installerbuilder/libinstaller/adminauthorization_x11.cpp b/installerbuilder/libinstaller/adminauthorization_x11.cpp index 3e8d03a18..ddef21199 100644 --- a/installerbuilder/libinstaller/adminauthorization_x11.cpp +++ b/installerbuilder/libinstaller/adminauthorization_x11.cpp @@ -62,10 +62,6 @@ AdminAuthorization::AdminAuthorization() { } -AdminAuthorization::~AdminAuthorization() -{ -} - bool AdminAuthorization::authorize() { return true; diff --git a/installerbuilder/libinstaller/component_p.cpp b/installerbuilder/libinstaller/component_p.cpp index 8478c3dc0..4409874bc 100644 --- a/installerbuilder/libinstaller/component_p.cpp +++ b/installerbuilder/libinstaller/component_p.cpp @@ -160,10 +160,6 @@ ComponentModelHelper::ComponentModelHelper() setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable); } -ComponentModelHelper::~ComponentModelHelper() -{ -} - /*! Returns the number of child components. Depending if virtual components are visible or not the count might differ from what one will get if calling Component::childComponents(...).count(). @@ -207,7 +203,7 @@ QList<Component*> ComponentModelHelper::childs() const Returns the component at index position in the list. Index must be a valid position in the list (i.e., index >= 0 && index < childCount()). Otherwise it returns 0. */ -Component* ComponentModelHelper::childAt(int index) const +Component *ComponentModelHelper::childAt(int index) const { if (index >= 0 && index < childCount()) { if (m_componentPrivate->m_core->virtualComponentsVisible()) diff --git a/installerbuilder/libinstaller/component_p.h b/installerbuilder/libinstaller/component_p.h index 56d6969ec..5cdedd522 100644 --- a/installerbuilder/libinstaller/component_p.h +++ b/installerbuilder/libinstaller/component_p.h @@ -112,7 +112,6 @@ public: }; explicit ComponentModelHelper(); - ~ComponentModelHelper(); int childCount() const; int indexInParent() const; @@ -153,7 +152,6 @@ private: ComponentPrivate *m_componentPrivate; }; - -} // namespace QInstaller +} // namespace QInstaller #endif // COMPONENT_P_H diff --git a/installerbuilder/libinstaller/componentmodel.cpp b/installerbuilder/libinstaller/componentmodel.cpp index 97a37f545..7532d3637 100644 --- a/installerbuilder/libinstaller/componentmodel.cpp +++ b/installerbuilder/libinstaller/componentmodel.cpp @@ -314,7 +314,7 @@ QModelIndex ComponentModel::indexFromComponentName(const QString &name) const Translates between a given QModelIndex \a index and it's associated Component. Returns the Component if the index is valid or 0 if an invalid QModelIndex is given. */ -Component* ComponentModel::componentFromIndex(const QModelIndex &index) const +Component *ComponentModel::componentFromIndex(const QModelIndex &index) const { if (index.isValid()) return static_cast<Component*>(index.internalPointer()); @@ -520,4 +520,4 @@ QModelIndexList ComponentModel::collectComponents(const QModelIndex &parent) con return list; } -} // namespace QInstaller +} // namespace QInstaller diff --git a/installerbuilder/libinstaller/copydirectoryoperation.cpp b/installerbuilder/libinstaller/copydirectoryoperation.cpp index 5e7bc282b..e514b0631 100644 --- a/installerbuilder/libinstaller/copydirectoryoperation.cpp +++ b/installerbuilder/libinstaller/copydirectoryoperation.cpp @@ -58,10 +58,6 @@ CopyDirectoryOperation::CopyDirectoryOperation() setName(QLatin1String("CopyDirectory")); } -CopyDirectoryOperation::~CopyDirectoryOperation() -{ -} - void CopyDirectoryOperation::backup() { } diff --git a/installerbuilder/libinstaller/copydirectoryoperation.h b/installerbuilder/libinstaller/copydirectoryoperation.h index 32e4f816e..74dac20f9 100644 --- a/installerbuilder/libinstaller/copydirectoryoperation.h +++ b/installerbuilder/libinstaller/copydirectoryoperation.h @@ -38,7 +38,6 @@ class INSTALLER_EXPORT CopyDirectoryOperation : public QObject, public Operation public: CopyDirectoryOperation(); - ~CopyDirectoryOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/createshortcutoperation.cpp b/installerbuilder/libinstaller/createshortcutoperation.cpp index 0beb7f61d..95bca56bd 100644 --- a/installerbuilder/libinstaller/createshortcutoperation.cpp +++ b/installerbuilder/libinstaller/createshortcutoperation.cpp @@ -116,10 +116,6 @@ CreateShortcutOperation::CreateShortcutOperation() setName(QLatin1String("CreateShortcut")); } -CreateShortcutOperation::~CreateShortcutOperation() -{ -} - static bool isWorkingDirOption(const QString &s) { return s.startsWith(QLatin1String("workingDirectory=")); diff --git a/installerbuilder/libinstaller/createshortcutoperation.h b/installerbuilder/libinstaller/createshortcutoperation.h index d505afa68..d27659c92 100644 --- a/installerbuilder/libinstaller/createshortcutoperation.h +++ b/installerbuilder/libinstaller/createshortcutoperation.h @@ -34,7 +34,6 @@ class INSTALLER_EXPORT CreateShortcutOperation : public Operation { public: CreateShortcutOperation(); - ~CreateShortcutOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/elevatedexecuteoperation.cpp b/installerbuilder/libinstaller/elevatedexecuteoperation.cpp index ec5d8179a..776a6caf1 100644 --- a/installerbuilder/libinstaller/elevatedexecuteoperation.cpp +++ b/installerbuilder/libinstaller/elevatedexecuteoperation.cpp @@ -37,7 +37,6 @@ #include "qprocesswrapper.h" #include <QThread> - #include <QProcessEnvironment> using namespace QInstaller; @@ -49,9 +48,6 @@ public: : q(qq), process(0), showStandardError(false) { } - ~Private() - { - } private: ElevatedExecuteOperation *const q; @@ -257,7 +253,7 @@ bool ElevatedExecuteOperation::undoOperation() if (found) args.append(argument); else - found = argument==QLatin1String("UNDOEXECUTE"); + found = argument == QLatin1String("UNDOEXECUTE"); } if (args.isEmpty()) return true; diff --git a/installerbuilder/libinstaller/environmentvariablesoperation.cpp b/installerbuilder/libinstaller/environmentvariablesoperation.cpp index ec89981f1..2c0bec3a8 100644 --- a/installerbuilder/libinstaller/environmentvariablesoperation.cpp +++ b/installerbuilder/libinstaller/environmentvariablesoperation.cpp @@ -42,6 +42,7 @@ #endif using namespace QInstaller; +using namespace KDUpdater; /* TRANSLATOR QInstaller::EnvironmentVariablesOperation @@ -52,16 +53,10 @@ EnvironmentVariableOperation::EnvironmentVariableOperation() setName(QLatin1String("EnvironmentVariable")); } -EnvironmentVariableOperation::~EnvironmentVariableOperation() -{ -} - void EnvironmentVariableOperation::backup() { } -using namespace KDUpdater; - #ifdef Q_WS_WIN static bool broadcastChange() { // Use SendMessageTimeout to Broadcast a message to the whole system to update settings of all diff --git a/installerbuilder/libinstaller/environmentvariablesoperation.h b/installerbuilder/libinstaller/environmentvariablesoperation.h index 8af871aeb..0c3255e72 100644 --- a/installerbuilder/libinstaller/environmentvariablesoperation.h +++ b/installerbuilder/libinstaller/environmentvariablesoperation.h @@ -34,13 +34,12 @@ class INSTALLER_EXPORT EnvironmentVariableOperation : public Operation { public: EnvironmentVariableOperation(); - ~EnvironmentVariableOperation(); void backup(); bool performOperation(); bool undoOperation(); bool testOperation(); - Operation* clone() const; + Operation *clone() const; }; } diff --git a/installerbuilder/libinstaller/extractarchiveoperation.cpp b/installerbuilder/libinstaller/extractarchiveoperation.cpp index 7e88fa917..baddb70c2 100644 --- a/installerbuilder/libinstaller/extractarchiveoperation.cpp +++ b/installerbuilder/libinstaller/extractarchiveoperation.cpp @@ -45,10 +45,6 @@ ExtractArchiveOperation::ExtractArchiveOperation() setName(QLatin1String("Extract")); } -ExtractArchiveOperation::~ExtractArchiveOperation() -{ -} - void ExtractArchiveOperation::backup() { // we need to backup on the fly... diff --git a/installerbuilder/libinstaller/extractarchiveoperation.h b/installerbuilder/libinstaller/extractarchiveoperation.h index a2a87af6f..b76083470 100644 --- a/installerbuilder/libinstaller/extractarchiveoperation.h +++ b/installerbuilder/libinstaller/extractarchiveoperation.h @@ -39,13 +39,12 @@ class INSTALLER_EXPORT ExtractArchiveOperation : public QObject, public Operatio public: ExtractArchiveOperation(); - ~ExtractArchiveOperation(); void backup(); bool performOperation(); bool undoOperation(); bool testOperation(); - Operation* clone() const; + Operation *clone() const; Q_SIGNALS: void outputTextChanged(const QString &progress); diff --git a/installerbuilder/libinstaller/fakestopprocessforupdateoperation.cpp b/installerbuilder/libinstaller/fakestopprocessforupdateoperation.cpp index 60db16ba2..5deb161d7 100644 --- a/installerbuilder/libinstaller/fakestopprocessforupdateoperation.cpp +++ b/installerbuilder/libinstaller/fakestopprocessforupdateoperation.cpp @@ -85,10 +85,6 @@ FakeStopProcessForUpdateOperation::FakeStopProcessForUpdateOperation() setName(QLatin1String("FakeStopProcessForUpdate")); } -FakeStopProcessForUpdateOperation::~FakeStopProcessForUpdateOperation() -{ -} - void FakeStopProcessForUpdateOperation::backup() { } diff --git a/installerbuilder/libinstaller/fakestopprocessforupdateoperation.h b/installerbuilder/libinstaller/fakestopprocessforupdateoperation.h index 2874a8cec..d6fa62d8c 100644 --- a/installerbuilder/libinstaller/fakestopprocessforupdateoperation.h +++ b/installerbuilder/libinstaller/fakestopprocessforupdateoperation.h @@ -32,17 +32,14 @@ namespace QInstaller { class FakeStopProcessForUpdateOperation : public Operation { - public: FakeStopProcessForUpdateOperation(); - ~FakeStopProcessForUpdateOperation(); void backup(); bool performOperation(); bool undoOperation(); bool testOperation(); - Operation* clone() const; - + Operation *clone() const; }; } diff --git a/installerbuilder/libinstaller/fsengineserver.cpp b/installerbuilder/libinstaller/fsengineserver.cpp index 2381ad55a..6777b9bf8 100644 --- a/installerbuilder/libinstaller/fsengineserver.cpp +++ b/installerbuilder/libinstaller/fsengineserver.cpp @@ -83,6 +83,7 @@ bool startDetached(const QString &program, const QStringList &args, const QStrin class QProcessSignalReceiver : public QObject { Q_OBJECT + public: QProcessSignalReceiver(QObject *parent = 0) : QObject(parent) @@ -95,10 +96,6 @@ public: connect(parent, SIGNAL(started()), this, SLOT(processStarted())); connect(parent, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(processStateChanged(QProcess::ProcessState))); - } - - ~QProcessSignalReceiver() - { } QList<QVariant> receivedSignals; @@ -109,7 +106,6 @@ private Q_SLOTS: void processReadyRead(); void processStarted(); void processStateChanged(QProcess::ProcessState newState); - }; /*! @@ -125,12 +121,7 @@ public: settings(0), process(0), signalReceiver(0) - { - } - - ~FSEngineConnectionThread() - { - } + {} protected: void run(); diff --git a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp index ba4a3ea24..47adfb18e 100644 --- a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp +++ b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp @@ -105,7 +105,7 @@ Q_SIGNALS: private: const QString m_archive; const QString m_targetDir; - QPointer<KDUpdater::FileDownloader> m_downloader; + QPointer<FileDownloader> m_downloader; }; diff --git a/installerbuilder/libinstaller/globalsettingsoperation.cpp b/installerbuilder/libinstaller/globalsettingsoperation.cpp index 58e939538..d3ac9be6d 100644 --- a/installerbuilder/libinstaller/globalsettingsoperation.cpp +++ b/installerbuilder/libinstaller/globalsettingsoperation.cpp @@ -40,10 +40,6 @@ GlobalSettingsOperation::GlobalSettingsOperation() setName(QLatin1String("GlobalConfig")); } -GlobalSettingsOperation::~GlobalSettingsOperation() -{ -} - void GlobalSettingsOperation::backup() { } diff --git a/installerbuilder/libinstaller/globalsettingsoperation.h b/installerbuilder/libinstaller/globalsettingsoperation.h index db1ea7537..59681345c 100644 --- a/installerbuilder/libinstaller/globalsettingsoperation.h +++ b/installerbuilder/libinstaller/globalsettingsoperation.h @@ -36,7 +36,6 @@ class INSTALLER_EXPORT GlobalSettingsOperation : public Operation { public: GlobalSettingsOperation(); - ~GlobalSettingsOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/init.cpp b/installerbuilder/libinstaller/init.cpp index 1fd59347a..191ec61ad 100644 --- a/installerbuilder/libinstaller/init.cpp +++ b/installerbuilder/libinstaller/init.cpp @@ -73,14 +73,12 @@ #include "common/utils.h" - -#include <QtPlugin> - #include <kdupdaterupdateoperation.h> #include <kdupdaterupdateoperationfactory.h> #include <kdupdaterfiledownloader.h> #include <kdupdaterfiledownloaderfactory.h> +#include <QtPlugin> #include <QNetworkProxyFactory> #include <unix/C/7zCrc.h> @@ -92,7 +90,7 @@ namespace NLzma { namespace NLzmaAr { void registerArcLzma(); } } namespace NLzma { namespace NLzma86Ar { void registerArcLzma86(); } } namespace NSplit { void registerArcSplit(); } namespace NXz { void registerArcxz(); } -namespace NZ {void registerArcZ(); } +namespace NZ { void registerArcZ(); } } void registerArc7z(); @@ -100,21 +98,23 @@ void registerArcCab(); void registerArcTar(); void registerArcZip(); -void registerCodecBCJ2(); -void registerCodecBCJ(); -void registerCodecBCJ(); -void registerCodecByteSwap(); -void registerCodecBZip2(); -void registerCodecCopy(); -void registerCodecDeflate64(); -void registerCodecDeflate(); -void registerCodecDelta(); -void registerCodecLZMA2(); -void registerCodecLZMA(); -void registerCodecPPMD(); -void registerCodec7zAES(); +void registerCodecBCJ2(); +void registerCodecBCJ(); +void registerCodecBCJ(); +void registerCodecByteSwap(); +void registerCodecBZip2(); +void registerCodecCopy(); +void registerCodecDeflate64(); +void registerCodecDeflate(); +void registerCodecDelta(); +void registerCodecLZMA2(); +void registerCodecLZMA(); +void registerCodecPPMD(); +void registerCodec7zAES(); using namespace NArchive; +using namespace KDUpdater; +using namespace QInstaller; static void initArchives() { @@ -122,9 +122,9 @@ static void initArchives() NGz::registerArcGZip(); NLzma::NLzmaAr::registerArcLzma(); NLzma::NLzma86Ar::registerArcLzma86(); - NArchive::NSplit::registerArcSplit(); - NArchive::NXz::registerArcxz(); - NArchive::NZ::registerArcZ(); + NSplit::registerArcSplit(); + NXz::registerArcxz(); + NZ::registerArcZ(); registerArc7z(); registerArcCab(); registerArcTar(); @@ -158,7 +158,7 @@ static void initResources() static void messageHandler(QtMsgType type, const char *msg) { - QInstaller::verbose() << msg << std::endl; + verbose() << msg << std::endl; if (type != QtFatalMsg && QString::fromLatin1(msg).contains(QLatin1String("Object::connect: "))) { //qFatal(msg); } @@ -167,45 +167,47 @@ static void messageHandler(QtMsgType type, const char *msg) void QInstaller::init() { ::initResources(); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::CreateShortcutOperation>(QLatin1String("CreateShortcut")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::CreateDesktopEntryOperation>(QLatin1String("CreateDesktopEntry")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::ExtractArchiveOperation>(QLatin1String("Extract")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::GlobalSettingsOperation>(QLatin1String("GlobalConfig")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::EnvironmentVariableOperation>(QLatin1String( "EnvironmentVariable")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::RegisterFileTypeOperation>(QLatin1String("RegisterFileType")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::SelfRestartOperation>(QLatin1String("SelfRestart")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::InstallIconsOperation>(QLatin1String("InstallIcons")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::ElevatedExecuteOperation>(QLatin1String("Execute")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::FakeStopProcessForUpdateOperation>(QLatin1String("FakeStopProcessForUpdate")); + + UpdateOperationFactory &factory = UpdateOperationFactory::instance(); + factory.registerUpdateOperation<CreateShortcutOperation>(QLatin1String("CreateShortcut")); + factory.registerUpdateOperation<CreateDesktopEntryOperation>(QLatin1String("CreateDesktopEntry")); + factory.registerUpdateOperation<ExtractArchiveOperation>(QLatin1String("Extract")); + factory.registerUpdateOperation<GlobalSettingsOperation>(QLatin1String("GlobalConfig")); + factory.registerUpdateOperation<EnvironmentVariableOperation>(QLatin1String( "EnvironmentVariable")); + factory.registerUpdateOperation<RegisterFileTypeOperation>(QLatin1String("RegisterFileType")); + factory.registerUpdateOperation<SelfRestartOperation>(QLatin1String("SelfRestart")); + factory.registerUpdateOperation<InstallIconsOperation>(QLatin1String("InstallIcons")); + factory.registerUpdateOperation<ElevatedExecuteOperation>(QLatin1String("Execute")); + factory.registerUpdateOperation<FakeStopProcessForUpdateOperation>(QLatin1String("FakeStopProcessForUpdate")); // added for NDK - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::SimpleMoveFileOperation>(QLatin1String("SimpleMoveFile")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::CopyDirectoryOperation>(QLatin1String("CopyDirectory")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::RegisterDocumentationOperation>(QLatin1String("RegisterDocumentation")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::RegisterQtInCreatorOperation>(QLatin1String("RegisterQtInCreator")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::RegisterQtInCreatorV2Operation>(QLatin1String("RegisterQtInCreatorV2")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::RegisterQtInCreatorV23Operation>(QLatin1String("RegisterQtInCreatorV23")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::RegisterToolChainOperation>(QLatin1String("RegisterToolChain") ); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::RegisterDefaultDebuggerOperation>(QLatin1String( "RegisterDefaultDebugger")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::SetDemosPathOnQtOperation>(QLatin1String("SetDemosPathOnQt")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::SetExamplesPathOnQtOperation>(QLatin1String("SetExamplesPathOnQt")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::SetPluginPathOnQtCoreOperation>(QLatin1String("SetPluginPathOnQtCore")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::SetImportsPathOnQtCoreOperation>(QLatin1String("SetImportsPathOnQtCore")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::SetPathOnQtCoreOperation>(QLatin1String("SetPathOnQtCore")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::SetQtCreatorValueOperation>(QLatin1String("SetQtCreatorValue")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::AddQtCreatorArrayValueOperation>(QLatin1String("AddQtCreatorArrayValue")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::QtPatchOperation>(QLatin1String("QtPatch")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::ReplaceOperation>(QLatin1String("Replace")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::LineReplaceOperation>(QLatin1String( "LineReplace" ) ); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::UpdateCreatorSettingsFrom21To22Operation>(QLatin1String("UpdateCreatorSettingsFrom21To22")); - - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::MinimumProgressOperation>(QLatin1String("MinimumProgress")); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation<QInstaller::LicenseOperation>(QLatin1String("License")); - - KDUpdater::FileDownloaderFactory::setFollowRedirects(true); + factory.registerUpdateOperation<SimpleMoveFileOperation>(QLatin1String("SimpleMoveFile")); + factory.registerUpdateOperation<CopyDirectoryOperation>(QLatin1String("CopyDirectory")); + factory.registerUpdateOperation<RegisterDocumentationOperation>(QLatin1String("RegisterDocumentation")); + factory.registerUpdateOperation<RegisterQtInCreatorOperation>(QLatin1String("RegisterQtInCreator")); + factory.registerUpdateOperation<RegisterQtInCreatorV2Operation>(QLatin1String("RegisterQtInCreatorV2")); + factory.registerUpdateOperation<RegisterQtInCreatorV23Operation>(QLatin1String("RegisterQtInCreatorV23")); + factory.registerUpdateOperation<RegisterToolChainOperation>(QLatin1String("RegisterToolChain") ); + factory.registerUpdateOperation<RegisterDefaultDebuggerOperation>(QLatin1String( "RegisterDefaultDebugger")); + factory.registerUpdateOperation<SetDemosPathOnQtOperation>(QLatin1String("SetDemosPathOnQt")); + factory.registerUpdateOperation<SetExamplesPathOnQtOperation>(QLatin1String("SetExamplesPathOnQt")); + factory.registerUpdateOperation<SetPluginPathOnQtCoreOperation>(QLatin1String("SetPluginPathOnQtCore")); + factory.registerUpdateOperation<SetImportsPathOnQtCoreOperation>(QLatin1String("SetImportsPathOnQtCore")); + factory.registerUpdateOperation<SetPathOnQtCoreOperation>(QLatin1String("SetPathOnQtCore")); + factory.registerUpdateOperation<SetQtCreatorValueOperation>(QLatin1String("SetQtCreatorValue")); + factory.registerUpdateOperation<AddQtCreatorArrayValueOperation>(QLatin1String("AddQtCreatorArrayValue")); + factory.registerUpdateOperation<QtPatchOperation>(QLatin1String("QtPatch")); + factory.registerUpdateOperation<ReplaceOperation>(QLatin1String("Replace")); + factory.registerUpdateOperation<LineReplaceOperation>(QLatin1String( "LineReplace" ) ); + factory.registerUpdateOperation<UpdateCreatorSettingsFrom21To22Operation>(QLatin1String("UpdateCreatorSettingsFrom21To22")); + + factory.registerUpdateOperation<MinimumProgressOperation>(QLatin1String("MinimumProgress")); + factory.registerUpdateOperation<LicenseOperation>(QLatin1String("License")); + + FileDownloaderFactory::setFollowRedirects(true); #ifdef Q_OS_MAC - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation< QInstaller::MacReplaceInstallNamesOperation>(QLatin1String("ReplaceInstallNames")); + factoryregisterUpdateOperation<MacReplaceInstallNamesOperation>(QLatin1String("ReplaceInstallNames")); #endif // Q_OS_MAC // load 7z stuff, if we're a static lib diff --git a/installerbuilder/libinstaller/init.h b/installerbuilder/libinstaller/init.h index 3d979bbdb..6b292844e 100644 --- a/installerbuilder/libinstaller/init.h +++ b/installerbuilder/libinstaller/init.h @@ -29,7 +29,9 @@ #include "installer_global.h" namespace QInstaller { - void INSTALLER_EXPORT init(); + +void INSTALLER_EXPORT init(); + } #endif // QINSTALLER_INIT_H diff --git a/installerbuilder/libinstaller/lazyplaintextedit.cpp b/installerbuilder/libinstaller/lazyplaintextedit.cpp index c8bd383d2..cc39197e3 100644 --- a/installerbuilder/libinstaller/lazyplaintextedit.cpp +++ b/installerbuilder/libinstaller/lazyplaintextedit.cpp @@ -34,7 +34,7 @@ #include <QScrollBar> -#define INTERVAL 20 +const int INTERVAL = 20; LazyPlainTextEdit::LazyPlainTextEdit(QWidget *parent) : QPlainTextEdit(parent), m_timerId(0) @@ -61,9 +61,8 @@ void LazyPlainTextEdit::append(const QString &text) // m_timerId = 0; //} m_chachedOutput.append(text + QLatin1String("\n")); - if (isVisible() && m_timerId == 0) { + if (isVisible() && m_timerId == 0) m_timerId = startTimer(INTERVAL); - } } void LazyPlainTextEdit::clear() diff --git a/installerbuilder/libinstaller/licenseoperation.cpp b/installerbuilder/libinstaller/licenseoperation.cpp index 637213114..0ba97b223 100644 --- a/installerbuilder/libinstaller/licenseoperation.cpp +++ b/installerbuilder/libinstaller/licenseoperation.cpp @@ -46,10 +46,6 @@ LicenseOperation::LicenseOperation() setName(QLatin1String("License")); } -LicenseOperation::~LicenseOperation() -{ -} - void LicenseOperation::backup() { } diff --git a/installerbuilder/libinstaller/licenseoperation.h b/installerbuilder/libinstaller/licenseoperation.h index 9b78f0157..6ae4e2a55 100644 --- a/installerbuilder/libinstaller/licenseoperation.h +++ b/installerbuilder/libinstaller/licenseoperation.h @@ -34,14 +34,12 @@ class INSTALLER_EXPORT LicenseOperation : public Operation { public: LicenseOperation(); - ~LicenseOperation(); void backup(); bool performOperation(); bool undoOperation(); bool testOperation(); Operation* clone() const; - }; } // namespace QInstaller diff --git a/installerbuilder/libinstaller/linereplaceoperation.cpp b/installerbuilder/libinstaller/linereplaceoperation.cpp index db9739773..6bba425d9 100644 --- a/installerbuilder/libinstaller/linereplaceoperation.cpp +++ b/installerbuilder/libinstaller/linereplaceoperation.cpp @@ -43,10 +43,6 @@ LineReplaceOperation::LineReplaceOperation() setName(QLatin1String("LineReplace")); } -LineReplaceOperation::~LineReplaceOperation() -{ -} - void LineReplaceOperation::backup() { } diff --git a/installerbuilder/libinstaller/linereplaceoperation.h b/installerbuilder/libinstaller/linereplaceoperation.h index e66cc22b7..c41cb65e2 100644 --- a/installerbuilder/libinstaller/linereplaceoperation.h +++ b/installerbuilder/libinstaller/linereplaceoperation.h @@ -34,7 +34,6 @@ class INSTALLER_EXPORT LineReplaceOperation : public Operation { public: LineReplaceOperation(); - ~LineReplaceOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/macrelocateqt.h b/installerbuilder/libinstaller/macrelocateqt.h index 0f334dd3c..1c1b5a303 100644 --- a/installerbuilder/libinstaller/macrelocateqt.h +++ b/installerbuilder/libinstaller/macrelocateqt.h @@ -26,7 +26,7 @@ #ifndef RELOCATOR_H #define RELOCATOR_H -#include <QStringList> +#include <QString> namespace QInstaller { diff --git a/installerbuilder/libinstaller/messageboxhandler.cpp b/installerbuilder/libinstaller/messageboxhandler.cpp index 260b20398..827dec631 100644 --- a/installerbuilder/libinstaller/messageboxhandler.cpp +++ b/installerbuilder/libinstaller/messageboxhandler.cpp @@ -112,18 +112,13 @@ static QList<T> reversed(const QList<T> &list) // -- MessageBoxHandler MessageBoxHandler *MessageBoxHandler::m_instance = 0; + MessageBoxHandler::MessageBoxHandler(QObject *parent) : QObject(parent) , m_defaultAction(MessageBoxHandler::AskUser) { } -// -- public - -MessageBoxHandler::~MessageBoxHandler() -{ -} - MessageBoxHandler *MessageBoxHandler::instance() { if (m_instance == 0) diff --git a/installerbuilder/libinstaller/messageboxhandler.h b/installerbuilder/libinstaller/messageboxhandler.h index 58e36afa0..b1dfda1dd 100644 --- a/installerbuilder/libinstaller/messageboxhandler.h +++ b/installerbuilder/libinstaller/messageboxhandler.h @@ -57,9 +57,8 @@ public: warningType }; - ~MessageBoxHandler(); - static MessageBoxHandler* instance(); - static QWidget* currentBestSuitParent(); + static MessageBoxHandler *instance(); + static QWidget *currentBestSuitParent(); void setDefaultAction(DefaultAction defaultAction); void setAutomaticAnswer(const QString &identifier, QMessageBox::StandardButton answer); diff --git a/installerbuilder/libinstaller/minimumprogressoperation.cpp b/installerbuilder/libinstaller/minimumprogressoperation.cpp index efc4d78e0..f58f5199f 100644 --- a/installerbuilder/libinstaller/minimumprogressoperation.cpp +++ b/installerbuilder/libinstaller/minimumprogressoperation.cpp @@ -40,10 +40,6 @@ MinimumProgressOperation::MinimumProgressOperation() setName(QLatin1String("MinimumProgress")); } -MinimumProgressOperation::~MinimumProgressOperation() -{ -} - void MinimumProgressOperation::backup() { } diff --git a/installerbuilder/libinstaller/minimumprogressoperation.h b/installerbuilder/libinstaller/minimumprogressoperation.h index 2bbf73b15..ab273a787 100644 --- a/installerbuilder/libinstaller/minimumprogressoperation.h +++ b/installerbuilder/libinstaller/minimumprogressoperation.h @@ -38,7 +38,6 @@ class MinimumProgressOperation : public QObject, public Operation public: MinimumProgressOperation(); - ~MinimumProgressOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/packagemanagercore.cpp b/installerbuilder/libinstaller/packagemanagercore.cpp index 5829134e7..6bb50ecac 100644 --- a/installerbuilder/libinstaller/packagemanagercore.cpp +++ b/installerbuilder/libinstaller/packagemanagercore.cpp @@ -939,7 +939,7 @@ bool PackageManagerCore::calculateComponentsToUninstall() const /*! Returns a list of components to uninstall. The list can be empty. */ -QList<Component*> PackageManagerCore::componentsToUninstall() const +QList<Component *> PackageManagerCore::componentsToUninstall() const { return d->m_componentsToUninstall.toList(); } @@ -1474,7 +1474,7 @@ bool PackageManagerCore::updateComponentData(struct Data &data, Component *compo } component->setUninstalled(); - const QString &localPath = component->localTempPath(); + const QString localPath = component->localTempPath(); if (isVerbose()) { static QString lastLocalPath; if (lastLocalPath != localPath) @@ -1530,7 +1530,7 @@ bool PackageManagerCore::updateComponentData(struct Data &data, Component *compo return true; } -void PackageManagerCore::storeReplacedComponents(QHash<QString, Component*> &components, const struct Data &data) +void PackageManagerCore::storeReplacedComponents(QHash<QString, Component *> &components, const struct Data &data) { QHash<Component*, QStringList>::const_iterator it = data.replacementToExchangeables.constBegin(); // remember all components that got a replacement, required for uninstall @@ -1637,7 +1637,7 @@ bool PackageManagerCore::fetchUpdaterPackages(const PackagesList &remotes, const emit startUpdaterComponentsReset(); d->clearUpdaterComponentLists(); - QHash<QString, QInstaller::Component*> components; + QHash<QString, QInstaller::Component *> components; Data data; data.runMode = UpdaterMode; @@ -1767,9 +1767,9 @@ void PackageManagerCore::resetComponentsToUserCheckedState() void PackageManagerCore::updateDisplayVersions(const QString &displayKey) { - QHash<QString, QInstaller::Component*> components; - const QList<QInstaller::Component*> componentList = availableComponents(); - foreach (QInstaller::Component* component, componentList) + QHash<QString, QInstaller::Component *> components; + const QList<QInstaller::Component *> componentList = availableComponents(); + foreach (QInstaller::Component *component, componentList) components[component->name()] = component; // set display version for all components in list @@ -1791,7 +1791,7 @@ void PackageManagerCore::updateDisplayVersions(const QString &displayKey) } QString PackageManagerCore::findDisplayVersion(const QString &componentName, - const QHash<QString, QInstaller::Component*> &components, + const QHash<QString, QInstaller::Component *> &components, const QString &versionKey, QHash<QString, bool> &visited) { const QString replaceWith = components.value(componentName)->value(scInheritVersion); diff --git a/installerbuilder/libinstaller/packagemanagercore_p.cpp b/installerbuilder/libinstaller/packagemanagercore_p.cpp index 6df44fe9a..4608ee112 100644 --- a/installerbuilder/libinstaller/packagemanagercore_p.cpp +++ b/installerbuilder/libinstaller/packagemanagercore_p.cpp @@ -298,7 +298,7 @@ void PackageManagerCorePrivate::clearUpdaterComponentLists() m_componentsToInstallCalculated = false; } -QList<Component*> &PackageManagerCorePrivate::replacementDependencyComponents(RunMode mode) +QList<Component *> &PackageManagerCorePrivate::replacementDependencyComponents(RunMode mode) { return mode == AllMode ? m_rootDependencyReplacements : m_updaterDependencyReplacements; } @@ -317,7 +317,7 @@ void PackageManagerCorePrivate::clearComponentsToInstall() m_toInstallComponentIdReasonHash.clear(); } -bool PackageManagerCorePrivate::appendComponentsToInstall(const QList<Component*> &components) +bool PackageManagerCorePrivate::appendComponentsToInstall(const QList<Component *> &components) { if (components.isEmpty()) { verbose() << "components list is empty in " << Q_FUNC_INFO << std::endl; @@ -355,7 +355,7 @@ bool PackageManagerCorePrivate::appendComponentsToInstall(const QList<Component* return false; } - QList<Component*> foundAutoDependOnList; + QList<Component *> foundAutoDependOnList; // All regular dependencies are resolved. Now we are looking for auto depend on components. foreach (Component *component, relevantComponentForAutoDependOn) { // If a components is already installed or is scheduled for installation, no need to check for @@ -688,8 +688,8 @@ void PackageManagerCorePrivate::callBeginInstallation(const QList<Component*> &c void PackageManagerCorePrivate::stopProcessesForUpdates(const QList<Component*> &components) { QStringList processList; - foreach (const Component *const i, components) - processList << m_core->replaceVariables(i->stopProcessForUpdateRequests()); + foreach (const Component *component, components) + processList << m_core->replaceVariables(component->stopProcessForUpdateRequests()); qSort(processList); processList.erase(std::unique(processList.begin(), processList.end()), processList.end()); @@ -697,7 +697,7 @@ void PackageManagerCorePrivate::stopProcessesForUpdates(const QList<Component*> return; while (true) { - const QList<KDSysInfo::ProcessInfo> allProcesses = KDSysInfo::runningProcesses(); + const QList<KDSysInfo::ProcessInfo> allProcesses = KDSysInfo::runningProcesses(); // FIXME: Unused? const QStringList processes = checkRunningProcessesFromList(processList); if (processes.isEmpty()) return; @@ -1292,7 +1292,7 @@ void PackageManagerCorePrivate::runPackageUpdater() if (!QFileInfo(installerBinaryPath()).isWritable() || !QFileInfo(packagesXml).isWritable()) adminRightsGained = m_core->gainAdminRights(); - const QList<Component*> componentsToInstall = m_core->orderedComponentsToInstall(); + const QList<Component *> componentsToInstall = m_core->orderedComponentsToInstall(); verbose() << "Install size: " << componentsToInstall.size() << " components " << std::endl; bool updateAdminRights = false; @@ -1308,7 +1308,7 @@ void PackageManagerCorePrivate::runPackageUpdater() OperationList undoOperations; OperationList nonRevertedOperations; - QHash<QString, Component*> componentsByName; + QHash<QString, Component *> componentsByName; // build a list of undo operations based on the checked state of the component foreach (Operation *operation, m_performedOperationsOld) { @@ -1953,14 +1953,14 @@ void PackageManagerCorePrivate::insertInstallReason(Component *component, const bool PackageManagerCorePrivate::appendComponentToUninstall(Component *component) { // remove all already resolved dependees - QSet<Component*> dependees = m_core->dependees(component).toSet().subtract(m_componentsToUninstall); + QSet<Component *> dependees = m_core->dependees(component).toSet().subtract(m_componentsToUninstall); if (dependees.isEmpty()) { setCheckedState(component, Qt::Unchecked); m_componentsToUninstall.insert(component); return true; } - QSet<Component*> dependeesToResolve; + QSet<Component *> dependeesToResolve; foreach (Component *dependee, dependees) { if (dependee->isInstalled()) { // keep them as already resolved @@ -2080,4 +2080,4 @@ void PackageManagerCorePrivate::handleMethodInvocationRequest(const QString &inv QMetaObject::invokeMethod(obj, qPrintable(invokableMethodName)); } -} // QInstaller +} // namespace QInstaller diff --git a/installerbuilder/libinstaller/performinstallationform.cpp b/installerbuilder/libinstaller/performinstallationform.cpp index d4a2d050a..64547bf87 100644 --- a/installerbuilder/libinstaller/performinstallationform.cpp +++ b/installerbuilder/libinstaller/performinstallationform.cpp @@ -47,7 +47,6 @@ using namespace QInstaller; - // -- PerformInstallationForm PerformInstallationForm::PerformInstallationForm(QObject *parent) @@ -60,10 +59,6 @@ PerformInstallationForm::PerformInstallationForm(QObject *parent) { } -PerformInstallationForm::~PerformInstallationForm() -{ -} - void PerformInstallationForm::setupUi(QWidget *widget) { QVBoxLayout *baseLayout = new QVBoxLayout(widget); diff --git a/installerbuilder/libinstaller/performinstallationform.h b/installerbuilder/libinstaller/performinstallationform.h index c2ab28f33..755cebee7 100644 --- a/installerbuilder/libinstaller/performinstallationform.h +++ b/installerbuilder/libinstaller/performinstallationform.h @@ -38,15 +38,14 @@ QT_END_NAMESPACE class LazyPlainTextEdit; - namespace QInstaller { class PerformInstallationForm : public QObject { Q_OBJECT + public: PerformInstallationForm(QObject *parent); - ~PerformInstallationForm(); void setupUi(QWidget *widget); void setDetailsWidgetVisible(bool visible); @@ -75,6 +74,6 @@ private: QTimer *m_updateTimer; }; -} //namespace QInstaller +} // namespace QInstaller #endif // PERFORMINSTALLATIONFORM_H diff --git a/installerbuilder/libinstaller/persistentsettings.cpp b/installerbuilder/libinstaller/persistentsettings.cpp index bb895cdf9..96a5755da 100644 --- a/installerbuilder/libinstaller/persistentsettings.cpp +++ b/installerbuilder/libinstaller/persistentsettings.cpp @@ -45,7 +45,6 @@ using namespace ProjectExplorer; PersistentSettingsReader::PersistentSettingsReader() { - } QVariant PersistentSettingsReader::restoreValue(const QString &variable) const @@ -127,11 +126,10 @@ void PersistentSettingsReader::readValues(const QDomElement &data) QDomElement child = data.firstChildElement(); for (; !child.isNull(); child = child.nextSiblingElement()) { - if (child.nodeName() == QLatin1String("variable")) { + if (child.nodeName() == QLatin1String("variable")) variable = child.text(); - } else { + else v = readValue(child); - } } m_valueMap.insert(variable, v); diff --git a/installerbuilder/libinstaller/qsettingswrapper.cpp b/installerbuilder/libinstaller/qsettingswrapper.cpp index 21e6640b9..ed6050758 100644 --- a/installerbuilder/libinstaller/qsettingswrapper.cpp +++ b/installerbuilder/libinstaller/qsettingswrapper.cpp @@ -113,7 +113,7 @@ public: const bool native; const QString fileName; QSettings settings; - mutable QTcpSocket* socket; + mutable QTcpSocket *socket; mutable QDataStream stream; }; @@ -129,21 +129,21 @@ QSettingsWrapper::QSettingsWrapper(const QString &organization, const QString &a QSettingsWrapper::QSettingsWrapper(QSettingsWrapper::Scope scope, const QString &organization, const QString &application, QObject *parent) : QObject(parent) - , d(new Private(static_cast<QSettings::Scope> (scope), organization, application)) + , d(new Private(static_cast<QSettings::Scope>(scope), organization, application)) { } QSettingsWrapper::QSettingsWrapper(QSettingsWrapper::Format format, QSettingsWrapper::Scope scope, const QString &organization, const QString &application, QObject *parent) : QObject(parent) - , d(new Private(static_cast<QSettings::Format> (format), static_cast<QSettings::Scope> (scope), + , d(new Private(static_cast<QSettings::Format>(format), static_cast<QSettings::Scope> (scope), organization, application)) { } QSettingsWrapper::QSettingsWrapper(const QString &fileName, QSettingsWrapper::Format format, QObject *parent) : QObject(parent) - , d(new Private(fileName, static_cast<QSettings::Format> (format))) + , d(new Private(fileName, static_cast<QSettings::Format>(format))) { } @@ -185,7 +185,7 @@ QString QSettingsWrapper::applicationName() const return static_cast<QString>(d->settings.applicationName()); } -void QSettingsWrapper::beginGroup(const QString& param1) +void QSettingsWrapper::beginGroup(const QString ¶m1) { if (d->createSocket()) callRemoteVoidMethod(d->stream, QLatin1String("QSettings::beginGroup"), param1); @@ -193,14 +193,14 @@ void QSettingsWrapper::beginGroup(const QString& param1) d->settings.beginGroup(param1); } -int QSettingsWrapper::beginReadArray(const QString& param1) +int QSettingsWrapper::beginReadArray(const QString ¶m1) { if (d->createSocket()) return callRemoteMethod<int>(d->stream, QLatin1String("QSettings::beginReadArray"), param1); return d->settings.beginReadArray(param1); } -void QSettingsWrapper::beginWriteArray(const QString& param1, int param2) +void QSettingsWrapper::beginWriteArray(const QString ¶m1, int param2) { if (d->createSocket()) callRemoteVoidMethod(d->stream, QLatin1String("QSettings::beginWriteArray"), param1, param2); @@ -313,14 +313,16 @@ void QSettingsWrapper::setArrayIndex(int param1) { if (d->createSocket()) callRemoteVoidMethod(d->stream, QLatin1String("QSettings::setArrayIndex"), param1); - else d->settings.setArrayIndex(param1); + else + d->settings.setArrayIndex(param1); } void QSettingsWrapper::setFallbacksEnabled(bool param1) { if (d->createSocket()) callRemoteVoidMethod(d->stream, QLatin1String("QSettings::setFallbacksEnabled"), param1); - else d->settings.setFallbacksEnabled(param1); + else + d->settings.setFallbacksEnabled(param1); } void QSettingsWrapper::setIniCodec(QTextCodec *codec) diff --git a/installerbuilder/libinstaller/qtcreatorpersistentsettings.cpp b/installerbuilder/libinstaller/qtcreatorpersistentsettings.cpp index 15ec53dfb..9bdacde9f 100644 --- a/installerbuilder/libinstaller/qtcreatorpersistentsettings.cpp +++ b/installerbuilder/libinstaller/qtcreatorpersistentsettings.cpp @@ -70,7 +70,6 @@ QHash<QString, QString> QtCreatorPersistentSettings::abiToDebuggerHash() return m_abiToDebuggerHash; } - QHash<QString, QString> QtCreatorPersistentSettings::readAbiToDebuggerHash() { if (m_fileName.isEmpty()) @@ -94,8 +93,6 @@ QHash<QString, QString> QtCreatorPersistentSettings::readAbiToDebuggerHash() return abiToDebuggerHash; } - - bool QtCreatorPersistentSettings::addToolChain(const QtCreatorToolChain &toolChain) { if (toolChain.key.isEmpty()) diff --git a/installerbuilder/libinstaller/qtpatch.cpp b/installerbuilder/libinstaller/qtpatch.cpp index 4e70a5300..c687adb55 100644 --- a/installerbuilder/libinstaller/qtpatch.cpp +++ b/installerbuilder/libinstaller/qtpatch.cpp @@ -45,7 +45,6 @@ #include <QCoreApplication> #include <QByteArrayMatcher> - #ifdef Q_OS_WIN #include <windows.h> // for Sleep #endif @@ -55,33 +54,27 @@ #include <time.h> #endif -//"anonymous" namespace to make clear that this is only for inside use -namespace { - void sleepCopiedFromQTest(int ms) - { - if (ms < 0) - return; - #ifdef Q_OS_WIN - Sleep(uint(ms)); - #else - struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; - nanosleep(&ts, NULL); - #endif - } - - void uiDetachedWait(int ms) - { - QTime timer; - timer.start(); - do { - QCoreApplication::processEvents(QEventLoop::AllEvents, ms); - sleepCopiedFromQTest(10); - } while (timer.elapsed() < ms); - } - - -}//"anonymous" namespace +static void sleepCopiedFromQTest(int ms) +{ + if (ms < 0) + return; +#ifdef Q_OS_WIN + Sleep(uint(ms)); +#else + struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; + nanosleep(&ts, NULL); +#endif +} +static void uiDetachedWait(int ms) +{ + QTime timer; + timer.start(); + do { + QCoreApplication::processEvents(QEventLoop::AllEvents, ms); + sleepCopiedFromQTest(10); + } while (timer.elapsed() < ms); +} QHash<QString, QByteArray> QtPatch::qmakeValues(const QString &qmakePath, QByteArray *qmakeOutput) { @@ -225,7 +218,6 @@ bool QtPatch::patchTextFile(const QString &fileName, return true; } - bool QtPatch::openFileForPatching(QFile *file) { if (file->openMode() == QIODevice::NotOpen) { diff --git a/installerbuilder/libinstaller/qtpatchoperation.cpp b/installerbuilder/libinstaller/qtpatchoperation.cpp index 5ee7083f0..1cd5c3538 100644 --- a/installerbuilder/libinstaller/qtpatchoperation.cpp +++ b/installerbuilder/libinstaller/qtpatchoperation.cpp @@ -38,7 +38,7 @@ #include "constants.h" #include "common/utils.h" -#include <packagemanagercore.h> +#include "packagemanagercore.h" #include <QMap> #include <QSet> @@ -47,82 +47,72 @@ #include <QDir> #include <QDebug> - - using namespace QInstaller; -//"anonymous" namespace to make clear that this is only for inside use -namespace { - QMap<QByteArray, QByteArray> generatePatchValueMap(const QByteArray &newQtPath, +static QMap<QByteArray, QByteArray> generatePatchValueMap(const QByteArray &newQtPath, const QHash<QString, QByteArray> &qmakeValueHash) - { - QMap<QByteArray, QByteArray> replaceMap; //first == searchstring: second == replace string - char nativeSeperator = QDir::separator().toAscii(); - QByteArray oldValue; - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_PREFIX")); - replaceMap.insert(QByteArray("qt_prfxpath=%1").replace("%1", oldValue), - QByteArray("qt_prfxpath=%1/").replace("%1/", newQtPath)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_DOCS")); - replaceMap.insert(QByteArray("qt_docspath=%1").replace("%1", oldValue), - QByteArray("qt_docspath=%1/doc").replace("%1/", newQtPath + nativeSeperator)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_HEADERS")); - replaceMap.insert(QByteArray("qt_hdrspath=%1").replace("%1", oldValue), - QByteArray("qt_hdrspath=%1/include").replace("%1/", newQtPath + nativeSeperator)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_LIBS")); - replaceMap.insert(QByteArray("qt_libspath=%1").replace("%1", oldValue), - QByteArray("qt_libspath=%1/lib").replace("%1/", newQtPath + nativeSeperator)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_BINS")); - replaceMap.insert(QByteArray("qt_binspath=%1").replace("%1", oldValue), - QByteArray("qt_binspath=%1/bin").replace("%1/", newQtPath + nativeSeperator)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_PLUGINS")); - replaceMap.insert(QByteArray("qt_plugpath=%1").replace("%1", oldValue), - QByteArray("qt_plugpath=%1/plugins").replace("%1/", newQtPath + nativeSeperator)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_IMPORTS")); - replaceMap.insert(QByteArray("qt_impspath=%1").replace("%1", oldValue), - QByteArray("qt_impspath=%1/imports").replace("%1/", newQtPath + nativeSeperator)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_DATA")); - replaceMap.insert( QByteArray("qt_datapath=%1").replace("%1", oldValue), - QByteArray("qt_datapath=%1/").replace("%1/", newQtPath + nativeSeperator)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_TRANSLATIONS")); - replaceMap.insert( QByteArray("qt_trnspath=%1").replace("%1", oldValue), - QByteArray("qt_trnspath=%1/translations").replace("%1/", newQtPath + nativeSeperator)); - - // This must not be patched. Commenting out to fix QTSDK-429 - // oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_CONFIGURATION")); - // replaceMap.insert( QByteArray("qt_stngpath=%1").replace("%1", oldValue), - // QByteArray("qt_stngpath=%1").replace("%1", newQtPath)); - - //examples and demoes can patched outside separately, - //but for cosmetic reasons - if the qt version gets no examples later. - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_EXAMPLES")); - replaceMap.insert( QByteArray("qt_xmplpath=%1").replace("%1", oldValue), - QByteArray("qt_xmplpath=%1/examples").replace("%1/", newQtPath + nativeSeperator)); - - oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_DEMOS")); - replaceMap.insert( QByteArray("qt_demopath=%1").replace("%1", oldValue), - QByteArray("qt_demopath=%1/demos").replace("%1/", newQtPath + nativeSeperator)); - - return replaceMap; - } - -} // anonymous namespace - -QtPatchOperation::QtPatchOperation() { - setName(QLatin1String("QtPatch")); + QMap<QByteArray, QByteArray> replaceMap; //first == searchstring: second == replace string + char nativeSeperator = QDir::separator().toAscii(); + QByteArray oldValue; + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_PREFIX")); + replaceMap.insert(QByteArray("qt_prfxpath=%1").replace("%1", oldValue), + QByteArray("qt_prfxpath=%1/").replace("%1/", newQtPath)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_DOCS")); + replaceMap.insert(QByteArray("qt_docspath=%1").replace("%1", oldValue), + QByteArray("qt_docspath=%1/doc").replace("%1/", newQtPath + nativeSeperator)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_HEADERS")); + replaceMap.insert(QByteArray("qt_hdrspath=%1").replace("%1", oldValue), + QByteArray("qt_hdrspath=%1/include").replace("%1/", newQtPath + nativeSeperator)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_LIBS")); + replaceMap.insert(QByteArray("qt_libspath=%1").replace("%1", oldValue), + QByteArray("qt_libspath=%1/lib").replace("%1/", newQtPath + nativeSeperator)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_BINS")); + replaceMap.insert(QByteArray("qt_binspath=%1").replace("%1", oldValue), + QByteArray("qt_binspath=%1/bin").replace("%1/", newQtPath + nativeSeperator)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_PLUGINS")); + replaceMap.insert(QByteArray("qt_plugpath=%1").replace("%1", oldValue), + QByteArray("qt_plugpath=%1/plugins").replace("%1/", newQtPath + nativeSeperator)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_IMPORTS")); + replaceMap.insert(QByteArray("qt_impspath=%1").replace("%1", oldValue), + QByteArray("qt_impspath=%1/imports").replace("%1/", newQtPath + nativeSeperator)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_DATA")); + replaceMap.insert( QByteArray("qt_datapath=%1").replace("%1", oldValue), + QByteArray("qt_datapath=%1/").replace("%1/", newQtPath + nativeSeperator)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_TRANSLATIONS")); + replaceMap.insert( QByteArray("qt_trnspath=%1").replace("%1", oldValue), + QByteArray("qt_trnspath=%1/translations").replace("%1/", newQtPath + nativeSeperator)); + + // This must not be patched. Commenting out to fix QTSDK-429 + // oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_CONFIGURATION")); + // replaceMap.insert( QByteArray("qt_stngpath=%1").replace("%1", oldValue), + // QByteArray("qt_stngpath=%1").replace("%1", newQtPath)); + + //examples and demoes can patched outside separately, + //but for cosmetic reasons - if the qt version gets no examples later. + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_EXAMPLES")); + replaceMap.insert( QByteArray("qt_xmplpath=%1").replace("%1", oldValue), + QByteArray("qt_xmplpath=%1/examples").replace("%1/", newQtPath + nativeSeperator)); + + oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_DEMOS")); + replaceMap.insert( QByteArray("qt_demopath=%1").replace("%1", oldValue), + QByteArray("qt_demopath=%1/demos").replace("%1/", newQtPath + nativeSeperator)); + + return replaceMap; } -QtPatchOperation::~QtPatchOperation() +QtPatchOperation::QtPatchOperation() { + setName(QLatin1String("QtPatch")); } void QtPatchOperation::backup() @@ -198,7 +188,7 @@ bool QtPatchOperation::performOperation() else if (type == QLatin1String("mac")) patchFileListFile.setFileName(QLatin1String(":/files-to-patch-macx")); - if (! patchFileListFile.open(QFile::ReadOnly)) { + if (!patchFileListFile.open(QFile::ReadOnly)) { setError(UserDefinedError); setErrorString(tr("Qt patch error: Can not open %1.(%2)").arg(patchFileListFile.fileName(), patchFileListFile.errorString())); diff --git a/installerbuilder/libinstaller/qtpatchoperation.h b/installerbuilder/libinstaller/qtpatchoperation.h index 177220278..340a381bf 100644 --- a/installerbuilder/libinstaller/qtpatchoperation.h +++ b/installerbuilder/libinstaller/qtpatchoperation.h @@ -34,7 +34,6 @@ class QtPatchOperation : public Operation { public: QtPatchOperation(); - ~QtPatchOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp b/installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp index da34ab066..4d490fc1a 100644 --- a/installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp +++ b/installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp @@ -48,28 +48,22 @@ using namespace QInstaller; using namespace ProjectExplorer; -namespace { //TODO move this to a general location it is used on some classes -QString fromNativeSeparatorsAllOS(const QString &pathName) +static QString fromNativeSeparatorsAllOS(const QString &pathName) { - QString n(pathName); - for (int i = 0; i < (int)n.length(); ++i) { - if (n[i] == QLatin1Char('\\')) + QString n = pathName; + for (int i = 0; i < n.size(); ++i) { + if (n.at(i) == QLatin1Char('\\')) n[i] = QLatin1Char('/'); } return n; } -} RegisterDefaultDebuggerOperation::RegisterDefaultDebuggerOperation() { setName(QLatin1String("RegisterDefaultDebugger")); } -RegisterDefaultDebuggerOperation::~RegisterDefaultDebuggerOperation() -{ -} - void RegisterDefaultDebuggerOperation::backup() { } @@ -95,7 +89,7 @@ bool RegisterDefaultDebuggerOperation::performOperation() QString toolChainsXmlFilePath; - PackageManagerCore *const core = qVariantValue<PackageManagerCore*>(value(QLatin1String("installer"))); + PackageManagerCore *const core = qVariantValue<PackageManagerCore *>(value(QLatin1String("installer"))); if (!core) { setError(UserDefinedError); setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name())); @@ -117,7 +111,6 @@ bool RegisterDefaultDebuggerOperation::performOperation() return false; } - creatorToolChainSettings.addDefaultDebugger(abiString, debuggerPath); return creatorToolChainSettings.save(); } @@ -135,7 +128,7 @@ bool RegisterDefaultDebuggerOperation::undoOperation() QString toolChainsXmlFilePath; - PackageManagerCore *const core = qVariantValue<PackageManagerCore*>(value(QLatin1String("installer"))); + PackageManagerCore *const core = qVariantValue<PackageManagerCore *>(value(QLatin1String("installer"))); if (!core) { setError(UserDefinedError); setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name())); diff --git a/installerbuilder/libinstaller/registerdefaultdebuggeroperation.h b/installerbuilder/libinstaller/registerdefaultdebuggeroperation.h index 08511b1af..82d5003cb 100644 --- a/installerbuilder/libinstaller/registerdefaultdebuggeroperation.h +++ b/installerbuilder/libinstaller/registerdefaultdebuggeroperation.h @@ -28,14 +28,12 @@ #include "qinstallerglobal.h" - namespace QInstaller { class RegisterDefaultDebuggerOperation : public Operation { public: RegisterDefaultDebuggerOperation(); - ~RegisterDefaultDebuggerOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/registerdocumentationoperation.cpp b/installerbuilder/libinstaller/registerdocumentationoperation.cpp index 3a771d7cc..a45e218bd 100644 --- a/installerbuilder/libinstaller/registerdocumentationoperation.cpp +++ b/installerbuilder/libinstaller/registerdocumentationoperation.cpp @@ -46,44 +46,38 @@ RegisterDocumentationOperation::RegisterDocumentationOperation() setName(QLatin1String("RegisterDocumentation")); } -RegisterDocumentationOperation::~RegisterDocumentationOperation() -{ -} - void RegisterDocumentationOperation::backup() { } -namespace { - // get the right filename of the qsettingsfile (root/user) - QString settingsFileName() - { - #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) - // If the system settings are writable, don't touch the user settings. - // The reason is that a doc registered while running with sudo could otherwise create - // a root-owned configuration file a user directory. - QScopedPointer<QSettings> settings(new QSettings(QSettings::IniFormat, - QSettings::SystemScope, QLatin1String("Nokia"), QLatin1String("QtCreator"))); - - // QSettings::isWritable isn't reliable enough in 4.7, determine writability experimentally - settings->setValue(QLatin1String("iswritable"), QLatin1String("accomplished")); - settings->sync(); - if (settings->status() == QSettings::NoError) { - // we can use the system settings - if (settings->contains(QLatin1String("iswritable"))) - settings->remove(QLatin1String("iswritable")); - } else { - // we have to use user settings - settings.reset(new QSettings(QSettings::IniFormat, QSettings::UserScope, - QLatin1String("Nokia"), QLatin1String("QtCreator"))); - } - - #else - QScopedPointer<QSettings> settings(new QSettings(QSettings::IniFormat, - QSettings::UserScope, QLatin1String("Nokia"), QLatin1String("QtCreator"))); - #endif - return settings->fileName(); - } +// get the right filename of the qsettingsfile (root/user) +static QString settingsFileName() +{ + #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) + // If the system settings are writable, don't touch the user settings. + // The reason is that a doc registered while running with sudo could otherwise create + // a root-owned configuration file a user directory. + QScopedPointer<QSettings> settings(new QSettings(QSettings::IniFormat, + QSettings::SystemScope, QLatin1String("Nokia"), QLatin1String("QtCreator"))); + + // QSettings::isWritable isn't reliable enough in 4.7, determine writability experimentally + settings->setValue(QLatin1String("iswritable"), QLatin1String("accomplished")); + settings->sync(); + if (settings->status() == QSettings::NoError) { + // we can use the system settings + if (settings->contains(QLatin1String("iswritable"))) + settings->remove(QLatin1String("iswritable")); + } else { + // we have to use user settings + settings.reset(new QSettings(QSettings::IniFormat, QSettings::UserScope, + QLatin1String("Nokia"), QLatin1String("QtCreator"))); + } + + #else + QScopedPointer<QSettings> settings(new QSettings(QSettings::IniFormat, + QSettings::UserScope, QLatin1String("Nokia"), QLatin1String("QtCreator"))); + #endif + return settings->fileName(); } bool RegisterDocumentationOperation::performOperation() @@ -93,12 +87,11 @@ bool RegisterDocumentationOperation::performOperation() if (args.count() != 1) { setError(InvalidArguments); setErrorString(tr("Invalid arguments in %0: %1 arguments given, 1 expected.") - .arg(name()).arg( args.count())); + .arg(name()).arg(args.count())); return false; } const QString helpFile = args.at(0); - QFileInfo fileInfo(settingsFileName()); QDir settingsDir(fileInfo.absolutePath() + QLatin1String("/qtcreator")); @@ -107,16 +100,16 @@ bool RegisterDocumentationOperation::performOperation() const QString collectionFile = settingsDir.absolutePath() + QLatin1String("/helpcollection.qhc"); qDebug() << "collectionFile: " << collectionFile; - if (!QFileInfo( helpFile ).exists()) { + if (!QFileInfo(helpFile).exists()) { setError(UserDefinedError); - setErrorString( tr("Could not register help file %1: File not found.").arg( helpFile ) ); + setErrorString(tr("Could not register help file %1: File not found.").arg(helpFile)); return false; } QHelpEngineCore help(collectionFile); QString oldData = help.customValue(QLatin1String("AddedDocs")).toString(); if (!oldData.isEmpty()) - oldData.append(QLatin1String(";")); + oldData.append(QLatin1Char(';')); const QString newData = oldData + QFileInfo(helpFile).absoluteFilePath(); if (!help.setCustomValue(QLatin1String("AddedDocs"), newData)) { setError(UserDefinedError); diff --git a/installerbuilder/libinstaller/registerdocumentationoperation.h b/installerbuilder/libinstaller/registerdocumentationoperation.h index c1ed9d564..265ee21be 100644 --- a/installerbuilder/libinstaller/registerdocumentationoperation.h +++ b/installerbuilder/libinstaller/registerdocumentationoperation.h @@ -34,7 +34,6 @@ class RegisterDocumentationOperation : public Operation { public: RegisterDocumentationOperation(); - ~RegisterDocumentationOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/registerfiletypeoperation.cpp b/installerbuilder/libinstaller/registerfiletypeoperation.cpp index dd5835406..39ec3efa0 100644 --- a/installerbuilder/libinstaller/registerfiletypeoperation.cpp +++ b/installerbuilder/libinstaller/registerfiletypeoperation.cpp @@ -41,10 +41,6 @@ RegisterFileTypeOperation::RegisterFileTypeOperation() setName(QLatin1String("RegisterFileType")); } -RegisterFileTypeOperation::~RegisterFileTypeOperation() -{ -} - void RegisterFileTypeOperation::backup() { } diff --git a/installerbuilder/libinstaller/registerfiletypeoperation.h b/installerbuilder/libinstaller/registerfiletypeoperation.h index 3c9a391bf..157da8497 100644 --- a/installerbuilder/libinstaller/registerfiletypeoperation.h +++ b/installerbuilder/libinstaller/registerfiletypeoperation.h @@ -34,7 +34,6 @@ class INSTALLER_EXPORT RegisterFileTypeOperation : public Operation { public: RegisterFileTypeOperation(); - ~RegisterFileTypeOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/registerqtoperation.cpp b/installerbuilder/libinstaller/registerqtoperation.cpp index 18656a3a3..50a287495 100644 --- a/installerbuilder/libinstaller/registerqtoperation.cpp +++ b/installerbuilder/libinstaller/registerqtoperation.cpp @@ -52,10 +52,6 @@ RegisterQtInCreatorOperation::RegisterQtInCreatorOperation() setName(QLatin1String("RegisterQtInCreator")); } -RegisterQtInCreatorOperation::~RegisterQtInCreatorOperation() -{ -} - void RegisterQtInCreatorOperation::backup() { } @@ -82,7 +78,7 @@ bool RegisterQtInCreatorOperation::performOperation() QString sbsPath = args.value(8); //this is for creator 2.2 - PackageManagerCore *const core = qVariantValue<PackageManagerCore*>(value(QLatin1String("installer"))); + PackageManagerCore *const core = qVariantValue<PackageManagerCore *>(value(QLatin1String("installer"))); if (!core) { setError(UserDefinedError); setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name())); @@ -91,7 +87,7 @@ bool RegisterQtInCreatorOperation::performOperation() QString toolChainsXmlFilePath = rootInstallPath + QLatin1String(ToolChainSettingsSuffixPath); bool isCreator22 = false; //in case of the fake installer this component doesn't exist - Component* creatorComponent = + Component *creatorComponent = core->componentByName(QLatin1String("com.nokia.ndk.tools.qtcreator.application")); if (creatorComponent) { const QString creatorVersion = creatorComponent->value(scInstalledVersion); @@ -222,7 +218,7 @@ bool RegisterQtInCreatorOperation::testOperation() return true; } -Operation* RegisterQtInCreatorOperation::clone() const +Operation *RegisterQtInCreatorOperation::clone() const { return new RegisterQtInCreatorOperation(); } diff --git a/installerbuilder/libinstaller/registerqtoperation.h b/installerbuilder/libinstaller/registerqtoperation.h index 41a8972e9..bba25bd41 100644 --- a/installerbuilder/libinstaller/registerqtoperation.h +++ b/installerbuilder/libinstaller/registerqtoperation.h @@ -34,7 +34,6 @@ class RegisterQtInCreatorOperation : public Operation { public: RegisterQtInCreatorOperation(); - ~RegisterQtInCreatorOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/registerqtv23operation.cpp b/installerbuilder/libinstaller/registerqtv23operation.cpp index 41eed026f..c709d849e 100644 --- a/installerbuilder/libinstaller/registerqtv23operation.cpp +++ b/installerbuilder/libinstaller/registerqtv23operation.cpp @@ -35,8 +35,8 @@ #include "constants.h" #include "packagemanagercore.h" #include "qtcreator_constants.h" - #include "persistentsettings.h" + #include <QString> #include <QFileInfo> #include <QDir> @@ -46,43 +46,36 @@ using namespace QInstaller; -namespace { -//TODO move this to a general location it is used on some classes -QString fromNativeSeparatorsAllOS(const QString &pathName) +// TODO: move this to a general location it is used on some classes +static QString fromNativeSeparatorsAllOS(const QString &pathName) { - QString n(pathName); - for (int i = 0; i < (int)n.length(); ++i) { - if (n[i] == QLatin1Char('\\')) + QString n = pathName; + for (int i = 0; i < n.size(); ++i) { + if (n.at(i) == QLatin1Char('\\')) n[i] = QLatin1Char('/'); } return n; } -inline QString absoluteQmakePath(const QString &path) +static QString absoluteQmakePath(const QString &path) { QString versionQmakePath = QDir(path).absolutePath(); - if ( !versionQmakePath.endsWith(QLatin1String("qmake")) - && !versionQmakePath.endsWith(QLatin1String("qmake.exe"))) - { -#if defined ( Q_OS_WIN ) + if (!versionQmakePath.endsWith(QLatin1String("qmake")) + && !versionQmakePath.endsWith(QLatin1String("qmake.exe"))) { +#if defined (Q_OS_WIN) versionQmakePath.append(QLatin1String("/bin/qmake.exe")); -#elif defined( Q_OS_UNIX ) +#elif defined(Q_OS_UNIX) versionQmakePath.append(QLatin1String("/bin/qmake")); #endif } return fromNativeSeparatorsAllOS(versionQmakePath); } -} RegisterQtInCreatorV23Operation::RegisterQtInCreatorV23Operation() { setName(QLatin1String("RegisterQtInCreatorV23")); } -RegisterQtInCreatorV23Operation::~RegisterQtInCreatorV23Operation() -{ -} - void RegisterQtInCreatorV23Operation::backup() { } diff --git a/installerbuilder/libinstaller/registerqtv23operation.h b/installerbuilder/libinstaller/registerqtv23operation.h index 6ffa045dd..6de664f19 100644 --- a/installerbuilder/libinstaller/registerqtv23operation.h +++ b/installerbuilder/libinstaller/registerqtv23operation.h @@ -34,7 +34,6 @@ class RegisterQtInCreatorV23Operation : public Operation { public: RegisterQtInCreatorV23Operation(); - ~RegisterQtInCreatorV23Operation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/registerqtv2operation.cpp b/installerbuilder/libinstaller/registerqtv2operation.cpp index bc9f566ba..fc46569ac 100644 --- a/installerbuilder/libinstaller/registerqtv2operation.cpp +++ b/installerbuilder/libinstaller/registerqtv2operation.cpp @@ -49,10 +49,6 @@ RegisterQtInCreatorV2Operation::RegisterQtInCreatorV2Operation() setName(QLatin1String("RegisterQtInCreatorV2")); } -RegisterQtInCreatorV2Operation::~RegisterQtInCreatorV2Operation() -{ -} - void RegisterQtInCreatorV2Operation::backup() { } diff --git a/installerbuilder/libinstaller/registerqtv2operation.h b/installerbuilder/libinstaller/registerqtv2operation.h index 2a2d3e158..d071e1c86 100644 --- a/installerbuilder/libinstaller/registerqtv2operation.h +++ b/installerbuilder/libinstaller/registerqtv2operation.h @@ -34,7 +34,6 @@ class RegisterQtInCreatorV2Operation : public Operation { public: RegisterQtInCreatorV2Operation(); - ~RegisterQtInCreatorV2Operation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/registertoolchainoperation.cpp b/installerbuilder/libinstaller/registertoolchainoperation.cpp index cf824efa4..4919b7e1c 100644 --- a/installerbuilder/libinstaller/registertoolchainoperation.cpp +++ b/installerbuilder/libinstaller/registertoolchainoperation.cpp @@ -53,10 +53,6 @@ RegisterToolChainOperation::RegisterToolChainOperation() setName(QLatin1String("RegisterToolChain")); } -RegisterToolChainOperation::~RegisterToolChainOperation() -{ -} - void RegisterToolChainOperation::backup() { } diff --git a/installerbuilder/libinstaller/registertoolchainoperation.h b/installerbuilder/libinstaller/registertoolchainoperation.h index 68f3c16b5..799bde7aa 100644 --- a/installerbuilder/libinstaller/registertoolchainoperation.h +++ b/installerbuilder/libinstaller/registertoolchainoperation.h @@ -52,7 +52,6 @@ class RegisterToolChainOperation : public Operation { public: RegisterToolChainOperation(); - ~RegisterToolChainOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/replaceoperation.cpp b/installerbuilder/libinstaller/replaceoperation.cpp index 807d557e8..224d6265e 100644 --- a/installerbuilder/libinstaller/replaceoperation.cpp +++ b/installerbuilder/libinstaller/replaceoperation.cpp @@ -43,10 +43,6 @@ ReplaceOperation::ReplaceOperation() setName(QLatin1String("Replace")); } -ReplaceOperation::~ReplaceOperation() -{ -} - void ReplaceOperation::backup() { } diff --git a/installerbuilder/libinstaller/replaceoperation.h b/installerbuilder/libinstaller/replaceoperation.h index a54434317..1a75c0fa0 100644 --- a/installerbuilder/libinstaller/replaceoperation.h +++ b/installerbuilder/libinstaller/replaceoperation.h @@ -34,7 +34,6 @@ class INSTALLER_EXPORT ReplaceOperation : public Operation { public: ReplaceOperation(); - ~ReplaceOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/selfrestartoperation.cpp b/installerbuilder/libinstaller/selfrestartoperation.cpp index 918d3d82d..6c58d31a7 100644 --- a/installerbuilder/libinstaller/selfrestartoperation.cpp +++ b/installerbuilder/libinstaller/selfrestartoperation.cpp @@ -42,10 +42,6 @@ SelfRestartOperation::SelfRestartOperation() setName(QLatin1String("SelfRestart")); } -SelfRestartOperation::~SelfRestartOperation() -{ -} - void SelfRestartOperation::backup() { setValue(QLatin1String("PreviousSelfRestart"), KDSelfRestarter::restartOnQuit()); @@ -53,14 +49,14 @@ void SelfRestartOperation::backup() bool SelfRestartOperation::performOperation() { - PackageManagerCore *const core = qVariantValue<PackageManagerCore*>(value(QLatin1String("installer"))); + PackageManagerCore *const core = qVariantValue<PackageManagerCore *>(value(QLatin1String("installer"))); if (!core) { setError(UserDefinedError); setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name())); return false; } - if(!core->isUpdater() && !core->isPackageManager()) { + if (!core->isUpdater() && !core->isPackageManager()) { setError(UserDefinedError); setErrorString(tr("Self Restart: Only valid within updater or packagemanager mode.")); return false; diff --git a/installerbuilder/libinstaller/selfrestartoperation.h b/installerbuilder/libinstaller/selfrestartoperation.h index 7810f9542..c845e9de4 100644 --- a/installerbuilder/libinstaller/selfrestartoperation.h +++ b/installerbuilder/libinstaller/selfrestartoperation.h @@ -34,7 +34,6 @@ class INSTALLER_EXPORT SelfRestartOperation : public Operation { public: SelfRestartOperation(); - ~SelfRestartOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/setdemospathonqtoperation.cpp b/installerbuilder/libinstaller/setdemospathonqtoperation.cpp index b6a603c90..19018b189 100644 --- a/installerbuilder/libinstaller/setdemospathonqtoperation.cpp +++ b/installerbuilder/libinstaller/setdemospathonqtoperation.cpp @@ -45,10 +45,6 @@ SetDemosPathOnQtOperation::SetDemosPathOnQtOperation() setName(QLatin1String("SetDemosPathOnQt")); } -SetDemosPathOnQtOperation::~SetDemosPathOnQtOperation() -{ -} - void SetDemosPathOnQtOperation::backup() { } diff --git a/installerbuilder/libinstaller/setdemospathonqtoperation.h b/installerbuilder/libinstaller/setdemospathonqtoperation.h index 0ec362656..b75ff1721 100644 --- a/installerbuilder/libinstaller/setdemospathonqtoperation.h +++ b/installerbuilder/libinstaller/setdemospathonqtoperation.h @@ -34,7 +34,6 @@ class SetDemosPathOnQtOperation : public Operation { public: SetDemosPathOnQtOperation(); - ~SetDemosPathOnQtOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/setexamplespathonqtoperation.cpp b/installerbuilder/libinstaller/setexamplespathonqtoperation.cpp index 26b2d4faa..cdd42d8a7 100644 --- a/installerbuilder/libinstaller/setexamplespathonqtoperation.cpp +++ b/installerbuilder/libinstaller/setexamplespathonqtoperation.cpp @@ -45,10 +45,6 @@ SetExamplesPathOnQtOperation::SetExamplesPathOnQtOperation() setName(QLatin1String("SetExamplesPathOnQt")); } -SetExamplesPathOnQtOperation::~SetExamplesPathOnQtOperation() -{ -} - void SetExamplesPathOnQtOperation::backup() { } diff --git a/installerbuilder/libinstaller/setexamplespathonqtoperation.h b/installerbuilder/libinstaller/setexamplespathonqtoperation.h index 94ed00c0a..34eba7557 100644 --- a/installerbuilder/libinstaller/setexamplespathonqtoperation.h +++ b/installerbuilder/libinstaller/setexamplespathonqtoperation.h @@ -34,7 +34,6 @@ class SetExamplesPathOnQtOperation : public Operation { public: SetExamplesPathOnQtOperation(); - ~SetExamplesPathOnQtOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/setimportspathonqtcoreoperation.cpp b/installerbuilder/libinstaller/setimportspathonqtcoreoperation.cpp index c3bb6e47f..ad2c2cd20 100644 --- a/installerbuilder/libinstaller/setimportspathonqtcoreoperation.cpp +++ b/installerbuilder/libinstaller/setimportspathonqtcoreoperation.cpp @@ -88,10 +88,6 @@ SetImportsPathOnQtCoreOperation::SetImportsPathOnQtCoreOperation() setName(QLatin1String("SetImportsPathOnQtCore")); } -SetImportsPathOnQtCoreOperation::~SetImportsPathOnQtCoreOperation() -{ -} - void SetImportsPathOnQtCoreOperation::backup() { } diff --git a/installerbuilder/libinstaller/setimportspathonqtcoreoperation.h b/installerbuilder/libinstaller/setimportspathonqtcoreoperation.h index ac25758bb..55fb51417 100644 --- a/installerbuilder/libinstaller/setimportspathonqtcoreoperation.h +++ b/installerbuilder/libinstaller/setimportspathonqtcoreoperation.h @@ -34,7 +34,6 @@ class SetImportsPathOnQtCoreOperation : public Operation { public: SetImportsPathOnQtCoreOperation(); - ~SetImportsPathOnQtCoreOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/setpathonqtcoreoperation.cpp b/installerbuilder/libinstaller/setpathonqtcoreoperation.cpp index 50c823df0..b32b2eecc 100644 --- a/installerbuilder/libinstaller/setpathonqtcoreoperation.cpp +++ b/installerbuilder/libinstaller/setpathonqtcoreoperation.cpp @@ -91,10 +91,6 @@ SetPathOnQtCoreOperation::SetPathOnQtCoreOperation() setName(QLatin1String("SetPathOnQtCore")); } -SetPathOnQtCoreOperation::~SetPathOnQtCoreOperation() -{ -} - void SetPathOnQtCoreOperation::backup() { } diff --git a/installerbuilder/libinstaller/setpathonqtcoreoperation.h b/installerbuilder/libinstaller/setpathonqtcoreoperation.h index d9f0d7c37..18932a013 100644 --- a/installerbuilder/libinstaller/setpathonqtcoreoperation.h +++ b/installerbuilder/libinstaller/setpathonqtcoreoperation.h @@ -40,7 +40,6 @@ class SetPathOnQtCoreOperation : public Operation { public: SetPathOnQtCoreOperation(); - ~SetPathOnQtCoreOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.cpp b/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.cpp index 07240cc95..6fb601a0c 100644 --- a/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.cpp +++ b/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.cpp @@ -50,7 +50,6 @@ namespace { return QByteArray(); } - QFile file(binaryPath); int readOpenCount = 0; while (!file.open(QFile::ReadOnly) && readOpenCount < 20000) { @@ -88,10 +87,6 @@ SetPluginPathOnQtCoreOperation::SetPluginPathOnQtCoreOperation() setName(QLatin1String("SetPluginPathOnQtCore")); } -SetPluginPathOnQtCoreOperation::~SetPluginPathOnQtCoreOperation() -{ -} - void SetPluginPathOnQtCoreOperation::backup() { } @@ -121,7 +116,7 @@ bool SetPluginPathOnQtCoreOperation::performOperation() #else libraryFiles << qtCoreLibraryDir + QLatin1String("/libQtCore.so"); #endif - foreach (const QString coreLibrary, libraryFiles) { + foreach (const QString &coreLibrary, libraryFiles) { if (QFile::exists(coreLibrary)) { QByteArray oldValue(getOldValue(coreLibrary)); Q_ASSERT(!oldValue.isEmpty()); diff --git a/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.h b/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.h index 6d35aa496..87624c792 100644 --- a/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.h +++ b/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.h @@ -34,7 +34,6 @@ class SetPluginPathOnQtCoreOperation : public Operation { public: SetPluginPathOnQtCoreOperation(); - ~SetPluginPathOnQtCoreOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/setqtcreatorvalueoperation.cpp b/installerbuilder/libinstaller/setqtcreatorvalueoperation.cpp index fa5ff3381..15ff9a2e9 100644 --- a/installerbuilder/libinstaller/setqtcreatorvalueoperation.cpp +++ b/installerbuilder/libinstaller/setqtcreatorvalueoperation.cpp @@ -40,13 +40,9 @@ using namespace QInstaller; -namespace { - QString groupName(const QString &groupName) - { - if (groupName == QLatin1String("General")) - return QString(); - return groupName; - } +static QString groupName(const QString &groupName) +{ + return groupName == QLatin1String("General") ? QString() : groupName; } SetQtCreatorValueOperation::SetQtCreatorValueOperation() @@ -54,10 +50,6 @@ SetQtCreatorValueOperation::SetQtCreatorValueOperation() setName(QLatin1String("SetQtCreatorValue")); } -SetQtCreatorValueOperation::~SetQtCreatorValueOperation() -{ -} - void SetQtCreatorValueOperation::backup() { } diff --git a/installerbuilder/libinstaller/setqtcreatorvalueoperation.h b/installerbuilder/libinstaller/setqtcreatorvalueoperation.h index e2c06ba9c..21b0b88cc 100644 --- a/installerbuilder/libinstaller/setqtcreatorvalueoperation.h +++ b/installerbuilder/libinstaller/setqtcreatorvalueoperation.h @@ -34,7 +34,6 @@ class SetQtCreatorValueOperation : public Operation { public: SetQtCreatorValueOperation(); - ~SetQtCreatorValueOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/simplemovefileoperation.cpp b/installerbuilder/libinstaller/simplemovefileoperation.cpp index 0a2edaf13..5fe0d811b 100644 --- a/installerbuilder/libinstaller/simplemovefileoperation.cpp +++ b/installerbuilder/libinstaller/simplemovefileoperation.cpp @@ -41,10 +41,6 @@ SimpleMoveFileOperation::SimpleMoveFileOperation() setName(QLatin1String("SimpleMoveFile")); } -SimpleMoveFileOperation::~SimpleMoveFileOperation() -{ -} - void SimpleMoveFileOperation::backup() { } diff --git a/installerbuilder/libinstaller/simplemovefileoperation.h b/installerbuilder/libinstaller/simplemovefileoperation.h index 5127835e3..73003f2ca 100644 --- a/installerbuilder/libinstaller/simplemovefileoperation.h +++ b/installerbuilder/libinstaller/simplemovefileoperation.h @@ -38,7 +38,6 @@ class INSTALLER_EXPORT SimpleMoveFileOperation : public QObject, public Operatio public: SimpleMoveFileOperation(); - ~SimpleMoveFileOperation(); void backup(); bool performOperation(); diff --git a/installerbuilder/libinstaller/templates.cpp b/installerbuilder/libinstaller/templates.cpp index 700e0c3e3..6e07fe3fa 100644 --- a/installerbuilder/libinstaller/templates.cpp +++ b/installerbuilder/libinstaller/templates.cpp @@ -149,7 +149,7 @@ RESULT callRemoteMethod(QDataStream &stream, const QString &name, const T1 & par } template<typename RESULT, typename T1, typename T2, typename T3> -RESULT callRemoteMethod(QDataStream &stream, const QString &name, const T1 ¶m1, const T2 & param2, +RESULT callRemoteMethod(QDataStream &stream, const QString &name, const T1 ¶m1, const T2 ¶m2, const T3 ¶m3) { stream.device()->readAll(); diff --git a/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp b/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp index afe4eb0c4..6e3ec8f21 100644 --- a/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp +++ b/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp @@ -77,9 +77,8 @@ bool removeInstallerRegisteredQtVersions(QSettings &settings, const QStringList //read all settings for Qt Versions QHash<QString, QVariant> oldSettingsAsHash; - foreach (const QString &key, settings.allKeys()) { + foreach (const QString &key, settings.allKeys()) oldSettingsAsHash.insert(key, settings.value(key)); - } qDebug() << QLatin1String("settings.allKeys(): ") << settings.allKeys(); //get the installer added Qt Version settings ids @@ -180,9 +179,8 @@ bool convertQtInstallerSettings(QSettings &settings, const QString &toolChainsXm QtCreatorPersistentSettings creatorToolChainSettings; - if (!creatorToolChainSettings.init(toolChainsXmlFilePath)) { + if (!creatorToolChainSettings.init(toolChainsXmlFilePath)) return false; - } foreach (const QString &mingwPath, mingwToolChains) { if (mingwPath.isEmpty()) @@ -273,10 +271,6 @@ UpdateCreatorSettingsFrom21To22Operation::UpdateCreatorSettingsFrom21To22Operati setName(QLatin1String("UpdateCreatorSettingsFrom21To22")); } -UpdateCreatorSettingsFrom21To22Operation::~UpdateCreatorSettingsFrom21To22Operation() -{ -} - void UpdateCreatorSettingsFrom21To22Operation::backup() { } diff --git a/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.h b/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.h index 3a4ed0ef5..95c51add1 100644 --- a/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.h +++ b/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.h @@ -34,15 +34,14 @@ class UpdateCreatorSettingsFrom21To22Operation : public Operation { public: UpdateCreatorSettingsFrom21To22Operation(); - ~UpdateCreatorSettingsFrom21To22Operation(); void backup(); bool performOperation(); bool undoOperation(); bool testOperation(); - Operation* clone() const; + Operation *clone() const; }; -} // namespace +} // namespace QInstaller #endif // UPDATECREATORSETTINGSFROM21TO22OPERATION_H diff --git a/installerbuilder/libinstaller/updater.cpp b/installerbuilder/libinstaller/updater.cpp index c0f474c93..f8d8ca906 100644 --- a/installerbuilder/libinstaller/updater.cpp +++ b/installerbuilder/libinstaller/updater.cpp @@ -86,7 +86,7 @@ bool Updater::checkForUpdates() QDomElement root = doc.createElement(QLatin1String("updates")); doc.appendChild(root); - QList< QInstaller::Component* >::const_iterator it; + QList<QInstaller::Component *>::const_iterator it; for (it = components.begin(); it != components.end(); ++it) { QDomElement update = doc.createElement(QLatin1String("update")); update.setAttribute(QLatin1String("name"), (*it)->value(scDisplayName)); diff --git a/installerbuilder/libinstaller/updatesettings.cpp b/installerbuilder/libinstaller/updatesettings.cpp index 6892b4078..629e6d3f2 100644 --- a/installerbuilder/libinstaller/updatesettings.cpp +++ b/installerbuilder/libinstaller/updatesettings.cpp @@ -57,11 +57,6 @@ public: return externalSettings ? *externalSettings : internalSettings; } - const QSettings &settings() const - { - return externalSettings ? *externalSettings : internalSettings; - } - static void setExternalSettings(QSettings *settings) { externalSettings = settings; @@ -97,7 +92,7 @@ void UpdateSettings::setSettingsSource(QSettings *settings) int UpdateSettings::updateInterval() const { - return d->settings().value(QLatin1String("updatesettings/interval"), static_cast<int> (Weekly)).toInt(); + return d->settings().value(QLatin1String("updatesettings/interval"), static_cast<int>(Weekly)).toInt(); } void UpdateSettings::setUpdateInterval(int seconds) @@ -137,7 +132,7 @@ void UpdateSettings::setCheckOnlyImportantUpdates(bool checkOnlyImportantUpdates QSet<Repository> UpdateSettings::repositories() const { - QSettings &settings = *(const_cast<QSettings*> (&d->settings())); + QSettings &settings = d->settings(); const int count = settings.beginReadArray(QLatin1String("updatesettings/repositories")); QSet<Repository> result; diff --git a/installerbuilder/libinstaller/updatesettings.h b/installerbuilder/libinstaller/updatesettings.h index 490dea838..c629abcba 100644 --- a/installerbuilder/libinstaller/updatesettings.h +++ b/installerbuilder/libinstaller/updatesettings.h @@ -51,7 +51,7 @@ public: Monthly = Daily * 30 }; - static void setSettingsSource(QSettings* settings); + static void setSettingsSource(QSettings *settings); int updateInterval() const; void setUpdateInterval(int seconds); |