From a73ad816a36cb2bb2391f68f1c79b01d6e6f7ec5 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 18 Jun 2015 15:14:06 +0200 Subject: [PATCH] QMakeProjectManager: Introduce member initialization. Change-Id: I69df0c22a215b2df12f63fdc47082e9797fc02ac Reviewed-by: Daniel Teske --- .../qmakeprojectmanager/addlibrarywizard.cpp | 2 +- .../qmakeprojectmanager/addlibrarywizard.h | 24 +++++------ .../desktopqmakerunconfiguration.cpp | 9 +---- .../desktopqmakerunconfiguration.h | 32 +++++++-------- .../qmakeprojectmanager/externaleditors.cpp | 3 +- .../qmakeprojectmanager/externaleditors.h | 2 +- .../librarydetailscontroller.cpp | 12 ------ .../librarydetailscontroller.h | 21 +++++----- .../qmakeprojectmanager/makefileparse.h | 14 ++----- src/plugins/qmakeprojectmanager/makestep.cpp | 8 ++-- src/plugins/qmakeprojectmanager/makestep.h | 12 +++--- .../profilecompletionassist.cpp | 3 -- .../profilecompletionassist.h | 1 - .../qmakeprojectmanager/profileeditor.cpp | 5 --- .../profilehoverhandler.cpp | 2 +- .../qmakeprojectmanager/profilehoverhandler.h | 2 +- .../qmakebuildconfiguration.cpp | 12 +----- .../qmakebuildconfiguration.h | 10 ++--- .../qmakeprojectmanager/qmakebuildinfo.h | 2 +- .../qmakekitconfigwidget.cpp | 3 +- .../qmakekitconfigwidget.h | 4 +- .../qmakeprojectmanager/qmakenodes.cpp | 20 ++-------- src/plugins/qmakeprojectmanager/qmakenodes.h | 36 +++++------------ .../qmakeprojectmanager/qmakeproject.cpp | 11 +---- .../qmakeprojectmanager/qmakeproject.h | 24 +++++------ .../qmakeprojectconfigwidget.cpp | 3 +- .../qmakeprojectconfigwidget.h | 2 +- .../qmakeprojectmanager.cpp | 7 ---- .../qmakeprojectmanager/qmakeprojectmanager.h | 7 ++-- .../qmakeprojectmanagerplugin.cpp | 6 --- .../qmakeprojectmanagerplugin.h | 33 ++++++++------- src/plugins/qmakeprojectmanager/qmakestep.cpp | 16 ++------ src/plugins/qmakeprojectmanager/qmakestep.h | 40 +++++++------------ 33 files changed, 137 insertions(+), 251 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp index c499e2e38a9..3b176e1db06 100644 --- a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp +++ b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp @@ -190,7 +190,7 @@ AddLibraryWizard::LibraryKind LibraryTypePage::libraryKind() const ///////////// DetailsPage::DetailsPage(AddLibraryWizard *parent) - : QWizardPage(parent), m_libraryWizard(parent), m_libraryDetailsController(0) + : QWizardPage(parent), m_libraryWizard(parent) { m_libraryDetailsWidget = new Ui::LibraryDetailsWidget(); m_libraryDetailsWidget->setupUi(this); diff --git a/src/plugins/qmakeprojectmanager/addlibrarywizard.h b/src/plugins/qmakeprojectmanager/addlibrarywizard.h index 624eff7e6dd..ab92fa98da2 100644 --- a/src/plugins/qmakeprojectmanager/addlibrarywizard.h +++ b/src/plugins/qmakeprojectmanager/addlibrarywizard.h @@ -93,9 +93,9 @@ public: signals: private: - LibraryTypePage *m_libraryTypePage; - DetailsPage *m_detailsPage; - SummaryPage *m_summaryPage; + LibraryTypePage *m_libraryTypePage = nullptr; + DetailsPage *m_detailsPage = nullptr; + SummaryPage *m_summaryPage = nullptr; QString m_proFile; }; @@ -109,10 +109,10 @@ public: AddLibraryWizard::LibraryKind libraryKind() const; private: - QRadioButton *m_internalRadio; - QRadioButton *m_externalRadio; - QRadioButton *m_systemRadio; - QRadioButton *m_packageRadio; + QRadioButton *m_internalRadio = nullptr; + QRadioButton *m_externalRadio = nullptr; + QRadioButton *m_systemRadio = nullptr; + QRadioButton *m_packageRadio = nullptr; }; class DetailsPage : public QWizardPage @@ -126,8 +126,8 @@ public: private: AddLibraryWizard *m_libraryWizard; - Ui::LibraryDetailsWidget *m_libraryDetailsWidget; - LibraryDetailsController *m_libraryDetailsController; + Ui::LibraryDetailsWidget *m_libraryDetailsWidget = nullptr; + LibraryDetailsController *m_libraryDetailsController = nullptr; }; class SummaryPage : public QWizardPage @@ -138,9 +138,9 @@ public: virtual void initializePage(); QString snippet() const; private: - AddLibraryWizard *m_libraryWizard; - QLabel *m_summaryLabel; - QLabel *m_snippetLabel; + AddLibraryWizard *m_libraryWizard = nullptr; + QLabel *m_summaryLabel = nullptr; + QLabel *m_snippetLabel = nullptr; QString m_snippet; }; diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp index d9a2515f5a9..37c66380cb9 100644 --- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp @@ -83,9 +83,7 @@ static Utils::FileName pathFromId(Core::Id id) DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, Core::Id id) : LocalApplicationRunConfiguration(parent, id), - m_proFilePath(pathFromId(id)), - m_runMode(ApplicationLauncher::Gui), - m_isUsingDyldImageSuffix(false) + m_proFilePath(pathFromId(id)) { addExtraAspect(new ProjectExplorer::LocalEnvironmentAspect(this)); @@ -174,10 +172,7 @@ void DesktopQmakeRunConfiguration::ctor() DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(DesktopQmakeRunConfiguration *qmakeRunConfiguration, QWidget *parent) : QWidget(parent), - m_qmakeRunConfiguration(qmakeRunConfiguration), - m_ignoreChange(false), - m_usingDyldImageSuffix(0), - m_isShown(false) + m_qmakeRunConfiguration(qmakeRunConfiguration) { QVBoxLayout *vboxTopLayout = new QVBoxLayout(this); vboxTopLayout->setMargin(0); diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h index d1e23c20372..6778ec6d0a8 100644 --- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h +++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h @@ -128,11 +128,11 @@ private: Utils::FileName m_proFilePath; // Full path to the Application Pro File // Cached startup sub project information - ProjectExplorer::ApplicationLauncher::Mode m_runMode; - bool m_isUsingDyldImageSuffix; + ProjectExplorer::ApplicationLauncher::Mode m_runMode = ProjectExplorer::ApplicationLauncher::Gui; + bool m_isUsingDyldImageSuffix = false; QString m_userWorkingDirectory; - bool m_parseSuccess; - bool m_parseInProgress; + bool m_parseSuccess = false; + bool m_parseInProgress = false; }; class DesktopQmakeRunConfigurationWidget : public QWidget @@ -165,19 +165,19 @@ private slots: void usingDyldImageSuffixChanged(bool); private: - DesktopQmakeRunConfiguration *m_qmakeRunConfiguration; - bool m_ignoreChange; - QLabel *m_disabledIcon; - QLabel *m_disabledReason; - QLabel *m_executableLineLabel; - Utils::PathChooser *m_workingDirectoryEdit; - QLineEdit *m_argumentsLineEdit; - QCheckBox *m_useTerminalCheck; - QCheckBox *m_useQvfbCheck; - QCheckBox *m_usingDyldImageSuffix; - QLineEdit *m_qmlDebugPort; + DesktopQmakeRunConfiguration *m_qmakeRunConfiguration = nullptr; + bool m_ignoreChange = false; + QLabel *m_disabledIcon = nullptr; + QLabel *m_disabledReason = nullptr; + QLabel *m_executableLineLabel = nullptr; + Utils::PathChooser *m_workingDirectoryEdit = nullptr; + QLineEdit *m_argumentsLineEdit = nullptr; + QCheckBox *m_useTerminalCheck = nullptr; + QCheckBox *m_useQvfbCheck = nullptr; + QCheckBox *m_usingDyldImageSuffix = nullptr; + QLineEdit *m_qmlDebugPort = nullptr; Utils::DetailsWidget *m_detailsContainer; - bool m_isShown; + bool m_isShown = false; }; class DesktopQmakeRunConfigurationFactory : public QmakeRunConfigurationFactory diff --git a/src/plugins/qmakeprojectmanager/externaleditors.cpp b/src/plugins/qmakeprojectmanager/externaleditors.cpp index e77bee6c852..58d3b80f083 100644 --- a/src/plugins/qmakeprojectmanager/externaleditors.cpp +++ b/src/plugins/qmakeprojectmanager/externaleditors.cpp @@ -210,8 +210,7 @@ DesignerExternalEditor::DesignerExternalEditor(QObject *parent) : ExternalQtEditor(designerIdC, QLatin1String(designerDisplayName), QLatin1String(Designer::Constants::FORM_MIMETYPE), - parent), - m_terminationMapper(0) + parent) { } diff --git a/src/plugins/qmakeprojectmanager/externaleditors.h b/src/plugins/qmakeprojectmanager/externaleditors.h index d5c4e6aefeb..b922dcdce78 100644 --- a/src/plugins/qmakeprojectmanager/externaleditors.h +++ b/src/plugins/qmakeprojectmanager/externaleditors.h @@ -139,7 +139,7 @@ private: typedef QMap ProcessCache; ProcessCache m_processCache; - QSignalMapper *m_terminationMapper; + QSignalMapper *m_terminationMapper = nullptr; }; } // namespace Internal diff --git a/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp b/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp index 3dfb8fd040b..286745f94c4 100644 --- a/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp +++ b/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp @@ -54,19 +54,7 @@ LibraryDetailsController::LibraryDetailsController( Ui::LibraryDetailsWidget *libraryDetails, const QString &proFile, QObject *parent) : QObject(parent), - m_platforms(AddLibraryWizard::LinuxPlatform - | AddLibraryWizard::MacPlatform - | AddLibraryWizard::WindowsMinGWPlatform - | AddLibraryWizard::WindowsMSVCPlatform), - m_linkageType(AddLibraryWizard::NoLinkage), - m_macLibraryType(AddLibraryWizard::NoLibraryType), m_proFile(proFile), - m_ignoreGuiSignals(false), - m_includePathChanged(false), - m_linkageRadiosVisible(true), - m_macLibraryRadiosVisible(true), - m_includePathVisible(true), - m_windowsGroupVisible(true), m_libraryDetailsWidget(libraryDetails) { switch (Utils::HostOsInfo::hostOs()) { diff --git a/src/plugins/qmakeprojectmanager/librarydetailscontroller.h b/src/plugins/qmakeprojectmanager/librarydetailscontroller.h index af99a145110..41a6591bf00 100644 --- a/src/plugins/qmakeprojectmanager/librarydetailscontroller.h +++ b/src/plugins/qmakeprojectmanager/librarydetailscontroller.h @@ -104,21 +104,24 @@ private: void showLinkageType(AddLibraryWizard::LinkageType linkageType); void showMacLibraryType(AddLibraryWizard::MacLibraryType libType); - AddLibraryWizard::Platforms m_platforms; - AddLibraryWizard::LinkageType m_linkageType; - AddLibraryWizard::MacLibraryType m_macLibraryType; + AddLibraryWizard::Platforms m_platforms = AddLibraryWizard::LinuxPlatform + | AddLibraryWizard::MacPlatform + | AddLibraryWizard::WindowsMinGWPlatform + | AddLibraryWizard::WindowsMSVCPlatform; + AddLibraryWizard::LinkageType m_linkageType = AddLibraryWizard::NoLinkage; + AddLibraryWizard::MacLibraryType m_macLibraryType = AddLibraryWizard::NoLibraryType; QString m_proFile; CreatorPlatform m_creatorPlatform; - bool m_ignoreGuiSignals; - bool m_includePathChanged; + bool m_ignoreGuiSignals = false; + bool m_includePathChanged = false; - bool m_linkageRadiosVisible; - bool m_macLibraryRadiosVisible; - bool m_includePathVisible; - bool m_windowsGroupVisible; + bool m_linkageRadiosVisible = true; + bool m_macLibraryRadiosVisible = true; + bool m_includePathVisible = true; + bool m_windowsGroupVisible = true; Ui::LibraryDetailsWidget *m_libraryDetailsWidget; }; diff --git a/src/plugins/qmakeprojectmanager/makefileparse.h b/src/plugins/qmakeprojectmanager/makefileparse.h index a5690929aa7..a7da0746fb7 100644 --- a/src/plugins/qmakeprojectmanager/makefileparse.h +++ b/src/plugins/qmakeprojectmanager/makefileparse.h @@ -75,16 +75,10 @@ private: class QmakeBuildConfig { public: - QmakeBuildConfig() - : explicitDebug(false), - explicitRelease(false), - explicitBuildAll(false), - explicitNoBuildAll(false) - {} - bool explicitDebug; - bool explicitRelease; - bool explicitBuildAll; - bool explicitNoBuildAll; + bool explicitDebug = false; + bool explicitRelease = false; + bool explicitBuildAll = false; + bool explicitNoBuildAll = false; }; MakefileState m_state; diff --git a/src/plugins/qmakeprojectmanager/makestep.cpp b/src/plugins/qmakeprojectmanager/makestep.cpp index cd64af84f83..b6991cf1bf3 100644 --- a/src/plugins/qmakeprojectmanager/makestep.cpp +++ b/src/plugins/qmakeprojectmanager/makestep.cpp @@ -63,8 +63,7 @@ const char CLEAN_KEY[] = "Qt4ProjectManager.MakeStep.Clean"; } MakeStep::MakeStep(BuildStepList *bsl) : - AbstractProcessStep(bsl, Core::Id(MAKESTEP_BS_ID)), - m_clean(false) + AbstractProcessStep(bsl, Core::Id(MAKESTEP_BS_ID)) { ctor(); } @@ -79,8 +78,7 @@ MakeStep::MakeStep(BuildStepList *bsl, MakeStep *bs) : } MakeStep::MakeStep(BuildStepList *bsl, Core::Id id) : - AbstractProcessStep(bsl, id), - m_clean(false) + AbstractProcessStep(bsl, id) { ctor(); } @@ -314,7 +312,7 @@ void MakeStep::setUserArguments(const QString &arguments) } MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep) - : BuildStepConfigWidget(), m_ui(new Internal::Ui::MakeStep), m_makeStep(makeStep), m_bc(0), m_ignoreChange(false) + : BuildStepConfigWidget(), m_ui(new Internal::Ui::MakeStep), m_makeStep(makeStep) { m_ui->setupUi(this); diff --git a/src/plugins/qmakeprojectmanager/makestep.h b/src/plugins/qmakeprojectmanager/makestep.h index a334ff4f62f..7586d989f92 100644 --- a/src/plugins/qmakeprojectmanager/makestep.h +++ b/src/plugins/qmakeprojectmanager/makestep.h @@ -109,8 +109,8 @@ private: void ctor(); void setMakeCommand(const QString &make); QStringList automaticallyAddedArguments() const; - bool m_clean; - bool m_scriptTarget; + bool m_clean = false; + bool m_scriptTarget = false; QString m_makeFileToCheck; QString m_userArgs; QString m_makeCmd; @@ -136,11 +136,11 @@ private slots: private: void setSummaryText(const QString &text); - Internal::Ui::MakeStep *m_ui; - MakeStep *m_makeStep; + Internal::Ui::MakeStep *m_ui = nullptr; + MakeStep *m_makeStep = nullptr; QString m_summaryText; - ProjectExplorer::BuildConfiguration *m_bc; - bool m_ignoreChange; + ProjectExplorer::BuildConfiguration *m_bc = nullptr; + bool m_ignoreChange = false; }; } // QmakeProjectManager diff --git a/src/plugins/qmakeprojectmanager/profilecompletionassist.cpp b/src/plugins/qmakeprojectmanager/profilecompletionassist.cpp index 36407376d4f..297043116fe 100644 --- a/src/plugins/qmakeprojectmanager/profilecompletionassist.cpp +++ b/src/plugins/qmakeprojectmanager/profilecompletionassist.cpp @@ -317,9 +317,6 @@ static const char *const functionKeywords[] = { // ------------------------------- // ProFileCompletionAssistProvider // ------------------------------- -ProFileCompletionAssistProvider::ProFileCompletionAssistProvider() -{} - void ProFileCompletionAssistProvider::init() { for (uint i = 0; i < sizeof variableKeywords / sizeof variableKeywords[0] - 1; i++) diff --git a/src/plugins/qmakeprojectmanager/profilecompletionassist.h b/src/plugins/qmakeprojectmanager/profilecompletionassist.h index 2ef25165a73..8ea39767666 100644 --- a/src/plugins/qmakeprojectmanager/profilecompletionassist.h +++ b/src/plugins/qmakeprojectmanager/profilecompletionassist.h @@ -43,7 +43,6 @@ class ProFileCompletionAssistProvider : public TextEditor::CompletionAssistProvi Q_OBJECT public: - ProFileCompletionAssistProvider(); void init(); ~ProFileCompletionAssistProvider(); diff --git a/src/plugins/qmakeprojectmanager/profileeditor.cpp b/src/plugins/qmakeprojectmanager/profileeditor.cpp index e57ef27cc67..41a0d303bb3 100644 --- a/src/plugins/qmakeprojectmanager/profileeditor.cpp +++ b/src/plugins/qmakeprojectmanager/profileeditor.cpp @@ -58,11 +58,6 @@ namespace Internal { class ProFileEditorWidget : public TextEditorWidget { -public: - ProFileEditorWidget() - { - } - protected: virtual Link findLinkAt(const QTextCursor &, bool resolveTarget = true, bool inNextSplit = false) override; diff --git a/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp b/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp index 7f094f64a0e..f7d875778a7 100644 --- a/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp +++ b/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp @@ -45,7 +45,7 @@ namespace QmakeProjectManager { namespace Internal { ProFileHoverHandler::ProFileHoverHandler(const TextEditor::Keywords &keywords) - : m_manualKind(UnknownManual), m_keywords(keywords) + : m_keywords(keywords) { } diff --git a/src/plugins/qmakeprojectmanager/profilehoverhandler.h b/src/plugins/qmakeprojectmanager/profilehoverhandler.h index 9b13c3c490b..1271c2931a7 100644 --- a/src/plugins/qmakeprojectmanager/profilehoverhandler.h +++ b/src/plugins/qmakeprojectmanager/profilehoverhandler.h @@ -66,7 +66,7 @@ private: const QString &keyword); QString m_docFragment; - ManualKind m_manualKind; + ManualKind m_manualKind = UnknownManual; const TextEditor::Keywords m_keywords; }; diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 92af58f4ace..f9a76f9c1cb 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -106,12 +106,7 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target) } QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Core::Id id) : - BuildConfiguration(target, id), - m_shadowBuild(true), - m_isEnabled(false), - m_qmakeBuildConfiguration(0), - m_subNodeBuild(0), - m_fileNodeBuild(0) + BuildConfiguration(target, id) { ctor(); } @@ -119,10 +114,7 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Core::Id id) : QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, QmakeBuildConfiguration *source) : BuildConfiguration(target, source), m_shadowBuild(source->m_shadowBuild), - m_isEnabled(false), - m_qmakeBuildConfiguration(source->m_qmakeBuildConfiguration), - m_subNodeBuild(0), // temporary value, so not copied - m_fileNodeBuild(0) + m_qmakeBuildConfiguration(source->m_qmakeBuildConfiguration) { cloneSteps(source); ctor(); diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h index f47c5514512..ee9582273d5 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h @@ -144,11 +144,11 @@ private: }; LastKitState m_lastKitState; - bool m_shadowBuild; - bool m_isEnabled; - QtSupport::BaseQtVersion::QmakeBuildConfigs m_qmakeBuildConfiguration; - QmakeProjectManager::QmakeProFileNode *m_subNodeBuild; - ProjectExplorer::FileNode *m_fileNodeBuild; + bool m_shadowBuild = true; + bool m_isEnabled = false; + QtSupport::BaseQtVersion::QmakeBuildConfigs m_qmakeBuildConfiguration = 0; + QmakeProjectManager::QmakeProFileNode *m_subNodeBuild = nullptr; + ProjectExplorer::FileNode *m_fileNodeBuild = nullptr; friend class Internal::QmakeProjectConfigWidget; friend class QmakeBuildConfigurationFactory; diff --git a/src/plugins/qmakeprojectmanager/qmakebuildinfo.h b/src/plugins/qmakeprojectmanager/qmakebuildinfo.h index 87f8fe17ce3..fd5debe8feb 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildinfo.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildinfo.h @@ -46,7 +46,7 @@ class QmakeBuildInfo : public ProjectExplorer::BuildInfo public: QmakeBuildInfo(const QmakeBuildConfigurationFactory *f) : ProjectExplorer::BuildInfo(f) { } - ProjectExplorer::BuildConfiguration::BuildType type; + ProjectExplorer::BuildConfiguration::BuildType type = ProjectExplorer::BuildConfiguration::Unknown; QString additionalArguments; QString makefile; QMakeStepConfig config; diff --git a/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.cpp b/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.cpp index 1f4001d9b42..9db367b6605 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.cpp @@ -41,8 +41,7 @@ namespace Internal { QmakeKitConfigWidget::QmakeKitConfigWidget(ProjectExplorer::Kit *k, const ProjectExplorer::KitInformation *ki) : ProjectExplorer::KitConfigWidget(k, ki), - m_lineEdit(new QLineEdit), - m_ignoreChange(false) + m_lineEdit(new QLineEdit) { refresh(); // set up everything according to kit m_lineEdit->setToolTip(toolTip()); diff --git a/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.h b/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.h index 7f2cfcb4c02..bc2a255a14e 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.h +++ b/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.h @@ -61,8 +61,8 @@ private slots: private: int findQtVersion(const int id) const; - QLineEdit *m_lineEdit; - bool m_ignoreChange; + QLineEdit *m_lineEdit = nullptr; + bool m_ignoreChange = false; }; } // namespace Internal diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 7de13272d18..3a0511c73e1 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -306,8 +306,7 @@ QmakePriFileNode::QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmak m_project(project), m_qmakeProFileNode(qmakeProFileNode), m_projectFilePath(filePath), - m_projectDir(filePath.toFileInfo().absolutePath()), - m_includedInExactParse(true) + m_projectDir(filePath.toFileInfo().absolutePath()) { Q_ASSERT(project); m_qmakePriFile = new QmakePriFile(this); @@ -335,19 +334,13 @@ struct InternalNode QList virtualfolders; QMap subnodes; FileNameList files; - FileType type; - int priority; + FileType type = UnknownFileType; + int priority = 0; QString displayName; QString typeName; QString fullPath; QIcon icon; - InternalNode() - { - type = UnknownFileType; - priority = 0; - } - ~InternalNode() { qDeleteAll(virtualfolders); @@ -1597,12 +1590,7 @@ bool QmakeProFileNode::isDeployable() const */ QmakeProFileNode::QmakeProFileNode(QmakeProject *project, const FileName &filePath) - : QmakePriFileNode(project, this, filePath), - m_validParse(false), - m_parseInProgress(true), - m_projectType(InvalidProject), - m_readerExact(0), - m_readerCumulative(0) + : QmakePriFileNode(project, this, filePath) { // The slot is a lambda, so that QmakeProFileNode does not need to be // a qobject. The lifetime of the m_parserFutureWatcher is shorter diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.h b/src/plugins/qmakeprojectmanager/qmakenodes.h index 149b3806d56..e6a6a02b279 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.h +++ b/src/plugins/qmakeprojectmanager/qmakenodes.h @@ -219,7 +219,7 @@ private: QMap > m_files; QSet m_recursiveEnumerateFiles; QSet m_watchedFolders; - bool m_includedInExactParse; + bool m_includedInExactParse = true; // managed by QmakeProFileNode friend class QmakeProjectManager::QmakeProFileNode; @@ -277,7 +277,7 @@ private: class QMAKEPROJECTMANAGER_EXPORT TargetInformation { public: - bool valid; + bool valid = false; QString target; QString destDir; QString buildDir; @@ -295,19 +295,9 @@ public: return !(*this == other); } - TargetInformation() - : valid(false) - {} - - TargetInformation(const TargetInformation &other) - : valid(other.valid), - target(other.target), - destDir(other.destDir), - buildDir(other.buildDir), - buildTarget(other.buildTarget) - { - } + TargetInformation() = default; + TargetInformation(const TargetInformation &other) = default; }; struct QMAKEPROJECTMANAGER_EXPORT InstallsItem { @@ -322,12 +312,6 @@ struct QMAKEPROJECTMANAGER_EXPORT InstallsList { QList items; }; -struct QMAKEPROJECTMANAGER_EXPORT ProjectVersion { - int major; - int minor; - int patch; -}; - // Implements ProjectNode for qmake .pro files class QMAKEPROJECTMANAGER_EXPORT QmakeProFileNode : public QmakePriFileNode { @@ -413,12 +397,12 @@ private: static TargetInformation targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass, const QString &buildDir, const QString &projectFilePath); static InstallsList installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir); - bool m_isDeployable; + bool m_isDeployable = false; - bool m_validParse; - bool m_parseInProgress; + bool m_validParse = false; + bool m_parseInProgress = true; - QmakeProjectType m_projectType; + QmakeProjectType m_projectType = InvalidProject; QmakeVariablesHash m_varValues; QMap m_uitimestamps; @@ -430,8 +414,8 @@ private: // Async stuff QFutureWatcher m_parseFutureWatcher; - QtSupport::ProFileReader *m_readerExact; - QtSupport::ProFileReader *m_readerCumulative; + QtSupport::ProFileReader *m_readerExact = nullptr; + QtSupport::ProFileReader *m_readerCumulative = nullptr; }; } // namespace QmakeProjectManager diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 41f7afdbf3a..9d54d2eafdd 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -311,18 +311,9 @@ bool QmakeProjectFile::reload(QString *errorString, ReloadFlag flag, ChangeType QmakeProject::QmakeProject(QmakeManager *manager, const QString &fileName) : m_manager(manager), - m_rootProjectNode(0), m_fileInfo(new QmakeProjectFile(fileName, this)), m_projectFiles(new QmakeProjectFiles), - m_qmakeVfs(new QMakeVfs), - m_qmakeGlobals(0), - m_qmakeGlobalsRefCnt(0), - m_asyncUpdateFutureInterface(0), - m_pendingEvaluateFuturesCount(0), - m_asyncUpdateState(Base), - m_cancelEvaluate(false), - m_centralizedFolderWatcher(0), - m_activeTarget(0) + m_qmakeVfs(new QMakeVfs) { setId(Constants::QMAKEPROJECT_ID); setProjectContext(Core::Context(QmakeProjectManager::Constants::PROJECT_ID)); diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index ccedabd2425..6d6b85d03d4 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -185,35 +185,35 @@ private: bool matchesKit(const ProjectExplorer::Kit *kit); QmakeManager *m_manager; - QmakeProFileNode *m_rootProjectNode; + QmakeProFileNode *m_rootProjectNode = 0; - Internal::QmakeProjectFile *m_fileInfo; + Internal::QmakeProjectFile *m_fileInfo = nullptr; // Current configuration QString m_oldQtIncludePath; QString m_oldQtLibsPath; // cached lists of all of files - Internal::QmakeProjectFiles *m_projectFiles; + Internal::QmakeProjectFiles *m_projectFiles = nullptr; - QMakeVfs *m_qmakeVfs; + QMakeVfs *m_qmakeVfs = nullptr; // cached data during project rescan - ProFileGlobals *m_qmakeGlobals; - int m_qmakeGlobalsRefCnt; + ProFileGlobals *m_qmakeGlobals = nullptr; + int m_qmakeGlobalsRefCnt = 0; QTimer m_asyncUpdateTimer; - QFutureInterface *m_asyncUpdateFutureInterface; - int m_pendingEvaluateFuturesCount; - AsyncUpdateState m_asyncUpdateState; - bool m_cancelEvaluate; + QFutureInterface *m_asyncUpdateFutureInterface = nullptr; + int m_pendingEvaluateFuturesCount = 0; + AsyncUpdateState m_asyncUpdateState = Base; + bool m_cancelEvaluate = false; QList m_partialEvaluate; QFuture m_codeModelFuture; - Internal::CentralizedFolderWatcher *m_centralizedFolderWatcher; + Internal::CentralizedFolderWatcher *m_centralizedFolderWatcher = nullptr; - ProjectExplorer::Target *m_activeTarget; + ProjectExplorer::Target *m_activeTarget = nullptr; friend class Internal::QmakeProjectFile; friend class Internal::QmakeProjectConfigWidget; diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp index 5f01755cf76..358dcae5fb3 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp @@ -47,8 +47,7 @@ using namespace ProjectExplorer; QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc) : NamedWidget(), - m_buildConfiguration(bc), - m_ignoreChange(false) + m_buildConfiguration(bc) { m_defaultShadowBuildDir = QmakeBuildConfiguration::shadowBuildDirectory(bc->target()->project()->projectFilePath().toString(), diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.h b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.h index 951f49f05a9..09d15a48466 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.h @@ -73,7 +73,7 @@ private: QmakeBuildConfiguration *m_buildConfiguration; Utils::DetailsWidget *m_detailsContainer; QString m_defaultShadowBuildDir; - bool m_ignoreChange; + bool m_ignoreChange = false; }; } // namespace Internal diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp index d8614bf7c8c..c6a2cee5b7a 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp @@ -58,13 +58,6 @@ using namespace TextEditor; namespace QmakeProjectManager { -QmakeManager::QmakeManager() - : m_contextNode(0), - m_contextProject(0), - m_contextFile(0) -{ -} - QmakeManager::~QmakeManager() { } diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h index e09aab99254..c098c737cda 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h @@ -54,7 +54,6 @@ class QMAKEPROJECTMANAGER_EXPORT QmakeManager : public ProjectExplorer::IProject Q_OBJECT public: - QmakeManager(); ~QmakeManager(); void registerProject(QmakeProject *project); @@ -95,9 +94,9 @@ private: void addLibrary(const QString &fileName, TextEditor::BaseTextEditor *editor = 0); void runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *node); - ProjectExplorer::Node *m_contextNode; - ProjectExplorer::Project *m_contextProject; - ProjectExplorer::FileNode *m_contextFile; + ProjectExplorer::Node *m_contextNode = nullptr; + ProjectExplorer::Project *m_contextProject = nullptr; + ProjectExplorer::FileNode *m_contextFile = nullptr; }; } // namespace QmakeProjectManager diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp index 8e5789b12f6..318eb172f6a 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp @@ -76,12 +76,6 @@ using namespace QmakeProjectManager::Internal; using namespace QmakeProjectManager; using namespace ProjectExplorer; -QmakeProjectManagerPlugin::QmakeProjectManagerPlugin() - : m_qmakeProjectManager(0), m_previousStartupProject(0), m_previousTarget(0) -{ - -} - QmakeProjectManagerPlugin::~QmakeProjectManagerPlugin() { } diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h index a052e462855..2d673a9af72 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h @@ -59,7 +59,6 @@ class QmakeProjectManagerPlugin : public ExtensionSystem::IPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmakeProjectManager.json") public: - QmakeProjectManagerPlugin(); ~QmakeProjectManagerPlugin(); bool initialize(const QStringList &arguments, QString *errorMessage); void extensionsInitialized(); @@ -78,23 +77,23 @@ private slots: #endif private: - QmakeManager *m_qmakeProjectManager; - QmakeProject *m_previousStartupProject; - ProjectExplorer::Target *m_previousTarget; + QmakeManager *m_qmakeProjectManager = nullptr; + QmakeProject *m_previousStartupProject = nullptr; + ProjectExplorer::Target *m_previousTarget = nullptr; - QAction *m_runQMakeAction; - QAction *m_runQMakeActionContextMenu; - Utils::ParameterAction *m_buildSubProjectContextMenu; - QAction *m_subProjectRebuildSeparator; - QAction *m_rebuildSubProjectContextMenu; - QAction *m_cleanSubProjectContextMenu; - QAction *m_buildFileContextMenu; - Utils::ParameterAction *m_buildSubProjectAction; - Utils::ParameterAction *m_rebuildSubProjectAction; - Utils::ParameterAction *m_cleanSubProjectAction; - Utils::ParameterAction *m_buildFileAction; - QAction *m_addLibraryAction; - QAction *m_addLibraryActionContextMenu; + QAction *m_runQMakeAction = nullptr; + QAction *m_runQMakeActionContextMenu = nullptr; + Utils::ParameterAction *m_buildSubProjectContextMenu = nullptr; + QAction *m_subProjectRebuildSeparator = nullptr; + QAction *m_rebuildSubProjectContextMenu = nullptr; + QAction *m_cleanSubProjectContextMenu = nullptr; + QAction *m_buildFileContextMenu = nullptr; + Utils::ParameterAction *m_buildSubProjectAction = nullptr; + Utils::ParameterAction *m_rebuildSubProjectAction = nullptr; + Utils::ParameterAction *m_cleanSubProjectAction = nullptr; + Utils::ParameterAction *m_buildFileAction = nullptr; + QAction *m_addLibraryAction = nullptr; + QAction *m_addLibraryActionContextMenu = nullptr; Core::Context m_projectContext; }; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 0f69f809c97..3945e9a2e51 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -75,22 +75,13 @@ const char QMAKE_QMLDEBUGLIB_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDeb } QMakeStep::QMakeStep(BuildStepList *bsl) : - AbstractProcessStep(bsl, Core::Id(QMAKE_BS_ID)), - m_forced(false), - m_needToRunQMake(false), - m_linkQmlDebuggingLibrary(DebugLink), - m_useQtQuickCompiler(false), - m_separateDebugInfo(false) + AbstractProcessStep(bsl, Core::Id(QMAKE_BS_ID)) { ctor(); } QMakeStep::QMakeStep(BuildStepList *bsl, Core::Id id) : - AbstractProcessStep(bsl, id), - m_forced(false), - m_linkQmlDebuggingLibrary(DebugLink), - m_useQtQuickCompiler(false), - m_separateDebugInfo(false) + AbstractProcessStep(bsl, id) { ctor(); } @@ -457,8 +448,7 @@ bool QMakeStep::fromMap(const QVariantMap &map) //// QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step) - : BuildStepConfigWidget(), m_ui(new Internal::Ui::QMakeStep), m_step(step), - m_ignoreChange(false) + : BuildStepConfigWidget(), m_ui(new Internal::Ui::QMakeStep), m_step(step) { m_ui->setupUi(this); diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index 0f3fb7be4ba..1b799be6a53 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -91,25 +91,15 @@ public: static TargetArchConfig targetArchFor(const ProjectExplorer::Abi &targetAbi, const QtSupport::BaseQtVersion *version); static OsType osTypeFor(const ProjectExplorer::Abi &targetAbi, const QtSupport::BaseQtVersion *version); - - QMakeStepConfig() - : archConfig(NoArch), - osType(NoOsType), - linkQmlDebuggingQQ1(false), - linkQmlDebuggingQQ2(false), - useQtQuickCompiler(false), - separateDebugInfo(false) - {} - QStringList toArguments() const; // Actual data - TargetArchConfig archConfig; - OsType osType; - bool linkQmlDebuggingQQ1; - bool linkQmlDebuggingQQ2; - bool useQtQuickCompiler; - bool separateDebugInfo; + TargetArchConfig archConfig = NoArch; + OsType osType = NoOsType; + bool linkQmlDebuggingQQ1 = false; + bool linkQmlDebuggingQQ2 = false; + bool useQtQuickCompiler = false; + bool separateDebugInfo = false; }; @@ -192,13 +182,13 @@ private: void ctor(); // last values - bool m_forced; - bool m_needToRunQMake; // set in init(), read in run() + bool m_forced = false; + bool m_needToRunQMake = false; // set in init(), read in run() QString m_userArgs; - QmlLibraryLink m_linkQmlDebuggingLibrary; - bool m_useQtQuickCompiler; - bool m_scriptTemplate; - bool m_separateDebugInfo; + QmlLibraryLink m_linkQmlDebuggingLibrary = DebugLink; + bool m_useQtQuickCompiler = false; + bool m_scriptTemplate = false; + bool m_separateDebugInfo = false; }; @@ -239,11 +229,11 @@ private: void setSummaryText(const QString &); - Internal::Ui::QMakeStep *m_ui; - QMakeStep *m_step; + Internal::Ui::QMakeStep *m_ui = nullptr; + QMakeStep *m_step = nullptr; QString m_summaryText; QString m_additionalSummaryText; - bool m_ignoreChange; + bool m_ignoreChange = false; }; } // namespace QmakeProjectManager