diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2016-02-03 17:21:12 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2016-02-04 10:44:54 +0000 |
commit | 063b9775a9d0404cae84417895ccb966750b5b55 (patch) | |
tree | d2ca74b7a50f170f9aa7565b65a8dd786a44e31f | |
parent | 9b3016c2e4b0214de41412e8c4f651de70d0bb0b (diff) |
Autotools: Modernize
* Use pragma once
* Make sure overrides are everywhere
* Clean up code here and there
* Remove useless code from initializer lists
Change-Id: I9c285a803ea36cb32d14b3335757fd4b57f27d02
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
26 files changed, 83 insertions, 198 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp index 05e9e94289..038755eb2c 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp @@ -53,10 +53,8 @@ const char AUTOGEN_STEP_ID[] = "AutotoolsProjectManager.AutogenStep"; ///////////////////////////// // AutogenStepFactory class ///////////////////////////// -AutogenStepFactory::AutogenStepFactory(QObject *parent) : - IBuildStepFactory(parent) -{ -} +AutogenStepFactory::AutogenStepFactory(QObject *parent) : IBuildStepFactory(parent) +{ } QList<Core::Id> AutogenStepFactory::availableCreationIds(BuildStepList *parent) const { @@ -122,21 +120,17 @@ bool AutogenStepFactory::canHandle(BuildStepList *parent) const //////////////////////// // AutogenStep class //////////////////////// -AutogenStep::AutogenStep(BuildStepList *bsl) : - AbstractProcessStep(bsl, Core::Id(AUTOGEN_STEP_ID)), - m_runAutogen(false) +AutogenStep::AutogenStep(BuildStepList *bsl) : AbstractProcessStep(bsl, Core::Id(AUTOGEN_STEP_ID)) { ctor(); } -AutogenStep::AutogenStep(BuildStepList *bsl, Core::Id id) : - AbstractProcessStep(bsl, id) +AutogenStep::AutogenStep(BuildStepList *bsl, Core::Id id) : AbstractProcessStep(bsl, id) { ctor(); } -AutogenStep::AutogenStep(BuildStepList *bsl, AutogenStep *bs) : - AbstractProcessStep(bsl, bs), +AutogenStep::AutogenStep(BuildStepList *bsl, AutogenStep *bs) : AbstractProcessStep(bsl, bs), m_additionalArguments(bs->additionalArguments()) { ctor(); @@ -236,15 +230,13 @@ bool AutogenStep::fromMap(const QVariantMap &map) ////////////////////////////////// AutogenStepConfigWidget::AutogenStepConfigWidget(AutogenStep *autogenStep) : m_autogenStep(autogenStep), - m_summaryText(), - m_additionalArguments(0) + m_additionalArguments(new QLineEdit) { QFormLayout *fl = new QFormLayout(this); fl->setMargin(0); fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); setLayout(fl); - m_additionalArguments = new QLineEdit(this); fl->addRow(tr("Arguments:"), m_additionalArguments); m_additionalArguments->setText(m_autogenStep->additionalArguments()); diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.h b/src/plugins/autotoolsprojectmanager/autogenstep.h index 3845b93643..bcc3f3ecac 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.h +++ b/src/plugins/autotoolsprojectmanager/autogenstep.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOGENSTEP_H -#define AUTOGENSTEP_H +#pragma once #include <projectexplorer/abstractprocessstep.h> @@ -114,7 +113,7 @@ private: void ctor(); QString m_additionalArguments; - bool m_runAutogen; + bool m_runAutogen = false; }; ////////////////////////////////// @@ -132,8 +131,8 @@ class AutogenStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget public: AutogenStepConfigWidget(AutogenStep *autogenStep); - QString displayName() const; - QString summaryText() const; + QString displayName() const override; + QString summaryText() const override; private slots: void updateDetails(); @@ -146,6 +145,3 @@ private: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // AUTOGENSTEP_H - diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp index 4b1c9a109d..fae2219fda 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp @@ -52,10 +52,8 @@ const char AUTORECONF_ADDITIONAL_ARGUMENTS_KEY[] = "AutotoolsProjectManager.Auto //////////////////////////////// // AutoreconfStepFactory class //////////////////////////////// -AutoreconfStepFactory::AutoreconfStepFactory(QObject *parent) : - IBuildStepFactory(parent) -{ -} +AutoreconfStepFactory::AutoreconfStepFactory(QObject *parent) : IBuildStepFactory(parent) +{ } QList<Core::Id> AutoreconfStepFactory::availableCreationIds(BuildStepList *parent) const { @@ -122,14 +120,12 @@ bool AutoreconfStepFactory::canHandle(BuildStepList *parent) const // AutoreconfStep class ///////////////////////// AutoreconfStep::AutoreconfStep(BuildStepList *bsl) : - AbstractProcessStep(bsl, Core::Id(AUTORECONF_STEP_ID)), - m_runAutoreconf(false) + AbstractProcessStep(bsl, Core::Id(AUTORECONF_STEP_ID)) { ctor(); } -AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Core::Id id) : - AbstractProcessStep(bsl, id) +AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Core::Id id) : AbstractProcessStep(bsl, id) { ctor(); } @@ -229,15 +225,13 @@ bool AutoreconfStep::fromMap(const QVariantMap &map) ////////////////////////////////////// AutoreconfStepConfigWidget::AutoreconfStepConfigWidget(AutoreconfStep *autoreconfStep) : m_autoreconfStep(autoreconfStep), - m_summaryText(), - m_additionalArguments(0) + m_additionalArguments(new QLineEdit(this)) { QFormLayout *fl = new QFormLayout(this); fl->setMargin(0); fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); setLayout(fl); - m_additionalArguments = new QLineEdit(this); fl->addRow(tr("Arguments:"), m_additionalArguments); m_additionalArguments->setText(m_autoreconfStep->additionalArguments()); diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.h b/src/plugins/autotoolsprojectmanager/autoreconfstep.h index 8182b98eea..8ab2c9e532 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.h +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTORECONFSTEP_H -#define AUTORECONFSTEP_H +#pragma once #include <projectexplorer/abstractprocessstep.h> @@ -114,7 +113,7 @@ private: void ctor(); QString m_additionalArguments; - bool m_runAutoreconf; + bool m_runAutoreconf = false; }; ////////////////////////////////////// @@ -132,8 +131,8 @@ class AutoreconfStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget public: AutoreconfStepConfigWidget(AutoreconfStep *autoreconfStep); - QString displayName() const; - QString summaryText() const; + QString displayName() const override; + QString summaryText() const override; private slots: void updateDetails(); @@ -146,6 +145,3 @@ private: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // AUTORECONFSTEP_H - diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index 222c5c2166..db67732357 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -57,8 +57,8 @@ using namespace ProjectExplorer::Constants; ////////////////////////////////////// // AutotoolsBuildConfiguration class ////////////////////////////////////// -AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent) - : BuildConfiguration(parent, Core::Id(AUTOTOOLS_BC_ID)) +AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent) : + BuildConfiguration(parent, Core::Id(AUTOTOOLS_BC_ID)) { // /<foobar> is used so the un-changed check in setBuildDirectory() works correctly. // The leading / is to avoid the relative the path expansion in BuildConfiguration::buildDirectory. @@ -70,13 +70,13 @@ NamedWidget *AutotoolsBuildConfiguration::createConfigWidget() return new AutotoolsBuildSettingsWidget(this); } -AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, Core::Id id) - : BuildConfiguration(parent, id) +AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, Core::Id id) : + BuildConfiguration(parent, id) { } AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, - AutotoolsBuildConfiguration *source) - : BuildConfiguration(parent, source) + AutotoolsBuildConfiguration *source) : + BuildConfiguration(parent, source) { cloneSteps(source); } @@ -86,8 +86,7 @@ AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, ////////////////////////////////////// AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory(QObject *parent) : IBuildConfigurationFactory(parent) -{ -} +{ } int AutotoolsBuildConfigurationFactory::priority(const Target *parent) const { diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h index 09e890bbe9..3bceb4cc3a 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSBUILDCONFIGURATION_H -#define AUTOTOOLSBUILDCONFIGURATION_H +#pragma once #include <projectexplorer/buildconfiguration.h> @@ -88,4 +87,3 @@ private: } // namespace Internal } // namespace AutotoolsProjectManager -#endif // AUTOTOOLSBUILDCONFIGURATION_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp index bd0e10a8d9..0519e2c039 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp @@ -46,13 +46,13 @@ using namespace AutotoolsProjectManager::Internal; using namespace ProjectExplorer; AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfiguration *bc) : + m_pathChooser(new Utils::PathChooser), m_buildConfiguration(bc) { QFormLayout *fl = new QFormLayout(this); fl->setContentsMargins(0, 0, 0, 0); fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); - m_pathChooser = new Utils::PathChooser(this); m_pathChooser->setEnabled(true); m_pathChooser->setExpectedKind(Utils::PathChooser::Directory); m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory()); diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h index add8bc13d8..c30ecc2c25 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSBUILDSETTINGSWIDGET_H -#define AUTOTOOLSBUILDSETTINGSWIDGET_H +#pragma once #include <projectexplorer/namedwidget.h> @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // AUTOTOOLSBUILDSETTINGSWIDGET_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsmanager.h b/src/plugins/autotoolsprojectmanager/autotoolsmanager.h index 3e05f9219c..dd857811ef 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsmanager.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsmanager.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSMANAGER_H -#define AUTOTOOLSMANAGER_H +#pragma once #include <projectexplorer/iprojectmanager.h> @@ -45,13 +44,9 @@ class AutotoolsManager : public ProjectExplorer::IProjectManager Q_OBJECT public: - AutotoolsManager() {} - - ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString); - QString mimeType() const; + ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString) override; + QString mimeType() const override; }; } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // AUTOTOOLSMANAGER_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp index 7ba5d50f13..0f64b50cd9 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp @@ -42,10 +42,10 @@ using namespace AutotoolsProjectManager::Internal; ////////////////////////////////////// AutotoolsOpenProjectWizard::AutotoolsOpenProjectWizard(AutotoolsManager *manager, const QString &sourceDirectory, - QWidget *parent) - : Utils::Wizard(parent), - m_manager(manager), - m_sourceDirectory(sourceDirectory) + QWidget *parent) : + Utils::Wizard(parent), + m_manager(manager), + m_sourceDirectory(sourceDirectory) { QDir dir(m_sourceDirectory); m_buildDirectory = dir.absolutePath(); @@ -79,8 +79,8 @@ void AutotoolsOpenProjectWizard::setBuildDirectory(const QString &directory) ///////////////////////// // BuildPathPage class ///////////////////////// -BuildPathPage::BuildPathPage(AutotoolsOpenProjectWizard *wizard) - : QWizardPage(wizard), m_wizard(wizard) +BuildPathPage::BuildPathPage(AutotoolsOpenProjectWizard *w) : QWizardPage(w), + m_pc(new Utils::PathChooser) { QFormLayout *fl = new QFormLayout; this->setLayout(fl); @@ -92,10 +92,10 @@ BuildPathPage::BuildPathPage(AutotoolsOpenProjectWizard *wizard) "This ensures that the source directory remains clean and enables multiple builds " "with different settings.")); fl->addWidget(label); - m_pc = new Utils::PathChooser(this); m_pc->setHistoryCompleter(QLatin1String("AutoTools.BuildDir.History")); - m_pc->setBaseDirectory(m_wizard->sourceDirectory()); - m_pc->setPath(m_wizard->buildDirectory()); + AutotoolsOpenProjectWizard *wiz = static_cast<AutotoolsOpenProjectWizard *>(wizard()); + m_pc->setBaseDirectory(wiz->sourceDirectory()); + m_pc->setPath(wiz->buildDirectory()); connect(m_pc, &Utils::PathChooser::rawPathChanged, this, &BuildPathPage::buildDirectoryChanged); fl->addRow(tr("Build directory:"), m_pc); setTitle(tr("Build Location")); @@ -103,5 +103,5 @@ BuildPathPage::BuildPathPage(AutotoolsOpenProjectWizard *wizard) void BuildPathPage::buildDirectoryChanged() { - m_wizard->setBuildDirectory(m_pc->path()); + static_cast<AutotoolsOpenProjectWizard *>(wizard())->setBuildDirectory(m_pc->path()); } diff --git a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h index bd80ec0f38..ab72cd0a34 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSOPENPROJECTWIZARD_H -#define AUTOTOOLSOPENPROJECTWIZARD_H +#pragma once #include <utils/wizard.h> @@ -42,13 +41,9 @@ class AutotoolsOpenProjectWizard : public Utils::Wizard Q_OBJECT public: - enum PageId - { - BuildPathPageId - }; + enum PageId { BuildPathPageId }; - AutotoolsOpenProjectWizard(AutotoolsManager *manager, - const QString &sourceDirectory, + AutotoolsOpenProjectWizard(AutotoolsManager *manager, const QString &sourceDirectory, QWidget *parent = 0); QString buildDirectory() const; @@ -73,10 +68,8 @@ private slots: void buildDirectoryChanged(); private: - AutotoolsOpenProjectWizard *m_wizard; Utils::PathChooser *m_pc; }; } // namespace Internal } // namespace AutotoolsProjectManager -#endif //AUTOTOOLSOPENPROJECTWIZARD_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp index e8b5186b2a..3470bf15d6 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp @@ -69,8 +69,7 @@ using namespace AutotoolsProjectManager::Internal; using namespace ProjectExplorer; AutotoolsProject::AutotoolsProject(AutotoolsManager *manager, const QString &fileName) : - m_fileWatcher(new Utils::FileSystemWatcher(this)), - m_makefileParserThread(0) + m_fileWatcher(new Utils::FileSystemWatcher(this)) { setId(Constants::AUTOTOOLS_PROJECT_ID); setProjectManager(manager); diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.h b/src/plugins/autotoolsprojectmanager/autotoolsproject.h index f3d191b1ed..e43ee163e0 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSPROJECT_H -#define AUTOTOOLSPROJECT_H +#pragma once #include <projectexplorer/project.h> @@ -41,7 +40,7 @@ namespace Utils { class FileSystemWatcher; } namespace ProjectExplorer { class Node; class FolderNode; -} +} // namespace ProjectExplorer namespace AutotoolsProjectManager { namespace Internal { @@ -76,7 +75,7 @@ public: protected: RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override; -private slots: +private: /** * Loads the project tree by parsing the makefiles. */ @@ -103,7 +102,6 @@ private slots: */ void onFileChanged(const QString &file); -private: /** * Creates folder-nodes and file-nodes for the project tree. */ @@ -128,7 +126,6 @@ private: */ void updateCppCodeModel(); -private: QString m_projectName; /// Return value for AutotoolsProject::files() @@ -139,12 +136,10 @@ private: QStringList m_watchedFiles; /// Responsible for parsing the makefiles asynchronously in a thread - MakefileParserThread *m_makefileParserThread; + MakefileParserThread *m_makefileParserThread = nullptr; QFuture<void> m_codeModelFuture; }; } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // AUTOTOOLSPROJECT_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectconstants.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectconstants.h index 4430ef66b6..d14a9177a0 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectconstants.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectconstants.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSPROJECTCONSTANTS_H -#define AUTOTOOLSPROJECTCONSTANTS_H +#pragma once namespace AutotoolsProjectManager { /** @@ -43,5 +42,3 @@ namespace Constants { const char PROJECT_CONTEXT[] = "AutotoolsProject.ProjectContext"; } // namespace Constants } // namespace AutotoolsProjectManager - -#endif // AUTOTOOLSPROJECTCONSTANTS_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.h index 4d43a55823..b4c6187d67 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSPROJECTFILE_H -#define AUTOTOOLSPROJECTFILE_H +#pragma once #include <coreplugin/idocument.h> @@ -60,5 +59,3 @@ public: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // AUTOTOOLSPROJECTFILE_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h index f9665621e7..f09681d8b4 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSPROJECTNODE_H -#define AUTOTOOLSPROJECTNODE_H +#pragma once #include <projectexplorer/projectnodes.h> @@ -57,5 +56,3 @@ public: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // AUTOTOOLSPROJECTNODE_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp index 9693718402..d5815515af 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp @@ -39,13 +39,8 @@ using namespace AutotoolsProjectManager::Internal; -AutotoolsProjectPlugin::AutotoolsProjectPlugin() -{ -} - void AutotoolsProjectPlugin::extensionsInitialized() -{ -} +{ } bool AutotoolsProjectPlugin::initialize(const QStringList &arguments, QString *errorString) diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h index ac58352764..58d9ba8b19 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef AUTOTOOLSPROJECTPLUGIN_H -#define AUTOTOOLSPROJECTPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -67,13 +66,9 @@ class AutotoolsProjectPlugin : public ExtensionSystem::IPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AutotoolsProjectManager.json") public: - AutotoolsProjectPlugin(); - - void extensionsInitialized(); - bool initialize(const QStringList &arguments, QString *errorString); + void extensionsInitialized() override; + bool initialize(const QStringList &arguments, QString *errorString) override; }; } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // AUTOTOOLSPROJECTPLUGIN_H diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp index 37e71dc07f..3defe93195 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.cpp +++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp @@ -67,10 +67,8 @@ static QString projectDirRelativeToBuildDir(BuildConfiguration *bc) { //////////////////////////////// // ConfigureStepFactory Class //////////////////////////////// -ConfigureStepFactory::ConfigureStepFactory(QObject *parent) : - IBuildStepFactory(parent) -{ -} +ConfigureStepFactory::ConfigureStepFactory(QObject *parent) : IBuildStepFactory(parent) +{ } QList<Core::Id> ConfigureStepFactory::availableCreationIds(BuildStepList *parent) const { @@ -137,20 +135,17 @@ bool ConfigureStepFactory::canHandle(BuildStepList *parent) const // ConfigureStep class //////////////////////// ConfigureStep::ConfigureStep(BuildStepList* bsl) : - AbstractProcessStep(bsl, Core::Id(CONFIGURE_STEP_ID)), - m_runConfigure(false) + AbstractProcessStep(bsl, Core::Id(CONFIGURE_STEP_ID)) { ctor(); } -ConfigureStep::ConfigureStep(BuildStepList *bsl, Core::Id id) : - AbstractProcessStep(bsl, id) +ConfigureStep::ConfigureStep(BuildStepList *bsl, Core::Id id) : AbstractProcessStep(bsl, id) { ctor(); } -ConfigureStep::ConfigureStep(BuildStepList *bsl, ConfigureStep *bs) : - AbstractProcessStep(bsl, bs), +ConfigureStep::ConfigureStep(BuildStepList *bsl, ConfigureStep *bs) : AbstractProcessStep(bsl, bs), m_additionalArguments(bs->additionalArguments()) { ctor(); @@ -252,15 +247,13 @@ bool ConfigureStep::fromMap(const QVariantMap &map) ///////////////////////////////////// ConfigureStepConfigWidget::ConfigureStepConfigWidget(ConfigureStep *configureStep) : m_configureStep(configureStep), - m_summaryText(), - m_additionalArguments(0) + m_additionalArguments(new QLineEdit) { QFormLayout *fl = new QFormLayout(this); fl->setMargin(0); fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); setLayout(fl); - m_additionalArguments = new QLineEdit(this); fl->addRow(tr("Arguments:"), m_additionalArguments); m_additionalArguments->setText(m_configureStep->additionalArguments()); diff --git a/src/plugins/autotoolsprojectmanager/configurestep.h b/src/plugins/autotoolsprojectmanager/configurestep.h index c95d6c9bca..37bb5490bc 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.h +++ b/src/plugins/autotoolsprojectmanager/configurestep.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef CONFIGURESTEP_H -#define CONFIGURESTEP_H +#pragma once #include <projectexplorer/abstractprocessstep.h> @@ -115,7 +114,7 @@ private: void ctor(); QString m_additionalArguments; - bool m_runConfigure; + bool m_runConfigure = false; }; ///////////////////////////////////// @@ -133,8 +132,8 @@ class ConfigureStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget public: ConfigureStepConfigWidget(ConfigureStep *configureStep); - QString displayName() const; - QString summaryText() const; + QString displayName() const override; + QString summaryText() const override; private slots: void updateDetails(); @@ -147,6 +146,3 @@ private: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // CONFIGURESTEP_H - diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp index 12ee5359da..54a375c67b 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp +++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp @@ -37,20 +37,8 @@ using namespace AutotoolsProjectManager::Internal; -MakefileParser::MakefileParser(const QString &makefile) : - QObject(), - m_success(false), - m_cancel(false), - m_mutex(), - m_makefile(makefile), - m_executable(), - m_sources(), - m_makefiles(), - m_includePaths(), - m_line(), - m_textStream() -{ -} +MakefileParser::MakefileParser(const QString &makefile) : m_makefile(makefile) +{ } MakefileParser::~MakefileParser() { diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.h b/src/plugins/autotoolsprojectmanager/makefileparser.h index e1c835a295..beaa1a57db 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.h +++ b/src/plugins/autotoolsprojectmanager/makefileparser.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef MAKEFILEPARSER_H -#define MAKEFILEPARSER_H +#pragma once #include <QMutex> #include <QStringList> @@ -258,10 +257,9 @@ private: */ bool maybeParseCPPFlag(const QString &term); -private: - bool m_success; ///< Return value for MakefileParser::parse(). + bool m_success = false; ///< Return value for MakefileParser::parse(). - bool m_cancel; ///< True, if the parsing should be cancelled. + bool m_cancel = false; ///< True, if the parsing should be cancelled. mutable QMutex m_mutex; ///< Mutex to protect m_cancel. QString m_makefile; ///< Filename of the makefile @@ -280,6 +278,3 @@ private: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // MAKEFILEPARSER_H - diff --git a/src/plugins/autotoolsprojectmanager/makefileparserthread.cpp b/src/plugins/autotoolsprojectmanager/makefileparserthread.cpp index 98a4b5ce1e..cfe7e9757f 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparserthread.cpp +++ b/src/plugins/autotoolsprojectmanager/makefileparserthread.cpp @@ -31,15 +31,7 @@ using namespace AutotoolsProjectManager::Internal; -MakefileParserThread::MakefileParserThread(const QString &makefile) : - QThread(), - m_parser(makefile), - m_mutex(), - m_hasError(false), - m_executable(), - m_sources(), - m_makefiles(), - m_includePaths() +MakefileParserThread::MakefileParserThread(const QString &makefile) : m_parser(makefile) { connect(&m_parser, &MakefileParser::status, this, &MakefileParserThread::status); diff --git a/src/plugins/autotoolsprojectmanager/makefileparserthread.h b/src/plugins/autotoolsprojectmanager/makefileparserthread.h index c7e0f60c0f..9a84740fb7 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparserthread.h +++ b/src/plugins/autotoolsprojectmanager/makefileparserthread.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef MAKEFILEPARSERTHREAD_H -#define MAKEFILEPARSERTHREAD_H +#pragma once #include "makefileparser.h" @@ -131,7 +130,7 @@ private: MakefileParser m_parser; ///< Is not accessible outside the thread mutable QMutex m_mutex; - bool m_hasError; ///< Return value for MakefileParserThread::hasError() + bool m_hasError = false; ///< Return value for MakefileParserThread::hasError() QString m_executable; ///< Return value for MakefileParserThread::executable() QStringList m_sources; ///< Return value for MakefileParserThread::sources() QStringList m_makefiles; ///< Return value for MakefileParserThread::makefiles() @@ -143,7 +142,3 @@ private: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // MAKEFILEPARSERTHREAD_H - - diff --git a/src/plugins/autotoolsprojectmanager/makestep.cpp b/src/plugins/autotoolsprojectmanager/makestep.cpp index 97f197c907..081188a103 100644 --- a/src/plugins/autotoolsprojectmanager/makestep.cpp +++ b/src/plugins/autotoolsprojectmanager/makestep.cpp @@ -59,8 +59,7 @@ const char MAKE_STEP_ADDITIONAL_ARGUMENTS_KEY[] = "AutotoolsProjectManager.MakeS ////////////////////////// // MakeStepFactory class ////////////////////////// -MakeStepFactory::MakeStepFactory(QObject *parent) : - IBuildStepFactory(parent) +MakeStepFactory::MakeStepFactory(QObject *parent) : IBuildStepFactory(parent) { setObjectName(QLatin1String("Autotools::MakeStepFactory")); } QList<Core::Id> MakeStepFactory::availableCreationIds(BuildStepList *parent) const @@ -122,22 +121,17 @@ BuildStep *MakeStepFactory::restore(BuildStepList *parent, const QVariantMap &ma ///////////////////// // MakeStep class ///////////////////// -MakeStep::MakeStep(BuildStepList* bsl) : - AbstractProcessStep(bsl, Core::Id(MAKE_STEP_ID)), - m_clean(false) +MakeStep::MakeStep(BuildStepList* bsl) : AbstractProcessStep(bsl, Core::Id(MAKE_STEP_ID)) { ctor(); } -MakeStep::MakeStep(BuildStepList *bsl, Core::Id id) : - AbstractProcessStep(bsl, id), - m_clean(false) +MakeStep::MakeStep(BuildStepList *bsl, Core::Id id) : AbstractProcessStep(bsl, id) { ctor(); } -MakeStep::MakeStep(BuildStepList *bsl, MakeStep *bs) : - AbstractProcessStep(bsl, bs), +MakeStep::MakeStep(BuildStepList *bsl, MakeStep *bs) : AbstractProcessStep(bsl, bs), m_buildTargets(bs->m_buildTargets), m_additionalArguments(bs->additionalArguments()), m_clean(bs->m_clean) diff --git a/src/plugins/autotoolsprojectmanager/makestep.h b/src/plugins/autotoolsprojectmanager/makestep.h index 974d84a105..e6accd6f8f 100644 --- a/src/plugins/autotoolsprojectmanager/makestep.h +++ b/src/plugins/autotoolsprojectmanager/makestep.h @@ -25,8 +25,7 @@ ** ****************************************************************************/ -#ifndef MAKESTEP_H -#define MAKESTEP_H +#pragma once #include <projectexplorer/abstractprocessstep.h> #include <projectexplorer/task.h> @@ -115,7 +114,7 @@ private: QStringList m_buildTargets; QString m_additionalArguments; - bool m_clean; + bool m_clean = false; }; /////////////////////////////// @@ -133,8 +132,8 @@ class MakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget public: MakeStepConfigWidget(MakeStep *makeStep); - QString displayName() const; - QString summaryText() const; + QString displayName() const override; + QString summaryText() const override; private slots: void updateDetails(); @@ -147,5 +146,3 @@ private: } // namespace Internal } // namespace AutotoolsProjectManager - -#endif // MAKESTEP_H |