Commit a73ad816 authored by Jarek Kobus's avatar Jarek Kobus

QMakeProjectManager: Introduce member initialization.

Change-Id: I69df0c22a215b2df12f63fdc47082e9797fc02ac
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent 995e3d98
......@@ -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);
......
......@@ -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;
};
......
......@@ -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);
......
......@@ -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
......
......@@ -210,8 +210,7 @@ DesignerExternalEditor::DesignerExternalEditor(QObject *parent) :
ExternalQtEditor(designerIdC,
QLatin1String(designerDisplayName),
QLatin1String(Designer::Constants::FORM_MIMETYPE),
parent),
m_terminationMapper(0)
parent)
{
}
......
......@@ -139,7 +139,7 @@ private:
typedef QMap<QString, QTcpSocket*> ProcessCache;
ProcessCache m_processCache;
QSignalMapper *m_terminationMapper;
QSignalMapper *m_terminationMapper = nullptr;
};
} // namespace Internal
......
......@@ -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()) {
......
......@@ -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;
};
......
......@@ -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;
......
......@@ -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);
......
......@@ -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
......
......@@ -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++)
......
......@@ -43,7 +43,6 @@ class ProFileCompletionAssistProvider : public TextEditor::CompletionAssistProvi
Q_OBJECT
public:
ProFileCompletionAssistProvider();
void init();
~ProFileCompletionAssistProvider();
......
......@@ -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;
......
......@@ -45,7 +45,7 @@ namespace QmakeProjectManager {
namespace Internal {
ProFileHoverHandler::ProFileHoverHandler(const TextEditor::Keywords &keywords)
: m_manualKind(UnknownManual), m_keywords(keywords)
: m_keywords(keywords)
{
}
......
......@@ -66,7 +66,7 @@ private:
const QString &keyword);
QString m_docFragment;
ManualKind m_manualKind;
ManualKind m_manualKind = UnknownManual;
const TextEditor::Keywords m_keywords;
};
......
......@@ -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();
......
......@@ -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;
......
......@@ -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;
......
......@@ -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());
......
......@@ -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
......
......@@ -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<InternalNode *> virtualfolders;
QMap<QString, InternalNode *> 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
......
......@@ -219,7 +219,7 @@ private:
QMap<ProjectExplorer::FileType, QSet<Utils::FileName> > m_files;
QSet<Utils::FileName> m_recursiveEnumerateFiles;
QSet<QString> 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<InstallsItem> 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<QString, QDateTime> m_uitimestamps;
......@@ -430,8 +414,8 @@ private:
// Async stuff
QFutureWatcher<Internal::EvalResult *> m_parseFutureWatcher;
QtSupport::ProFileReader *m_readerExact;
QtSupport::ProFileReader *m_readerCumulative;
QtSupport::ProFileReader *m_readerExact = nullptr;
QtSupport::ProFileReader *m_readerCumulative = nullptr;
};
} // namespace QmakeProjectManager
......
......@@ -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));
......
......@@ -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<void> *m_asyncUpdateFutureInterface;
int m_pendingEvaluateFuturesCount;
AsyncUpdateState m_asyncUpdateState;
bool m_cancelEvaluate;
QFutureInterface<void> *m_asyncUpdateFutureInterface = nullptr;
int m_pendingEvaluateFuturesCount = 0;
AsyncUpdateState m_asyncUpdateState = Base;
bool m_cancelEvaluate = false;
QList<QmakeProFileNode *> m_partialEvaluate;
QFuture<void> 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;
......
......@@ -47,8 +47,7 @@ using namespace ProjectExplorer;
QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)