QmakeProjectManager: Auto-register aspects

Change-Id: I61b41b0155e125173e48686d1482bb8bd94055da
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-05-31 18:03:31 +02:00
parent 7d40a35d9e
commit 00f427f68e
2 changed files with 3 additions and 6 deletions

View File

@@ -26,7 +26,6 @@ QmakeSettings::QmakeSettings()
setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
setSettingsGroup("QmakeProjectManager");
registerAspect(&warnAgainstUnalignedBuildDir);
warnAgainstUnalignedBuildDir.setSettingsKey("WarnAgainstUnalignedBuildDir");
warnAgainstUnalignedBuildDir.setDefaultValue(HostOsInfo::isWindowsHost());
warnAgainstUnalignedBuildDir.setLabelText(Tr::tr("Warn if a project's source and "
@@ -34,13 +33,11 @@ QmakeSettings::QmakeSettings()
warnAgainstUnalignedBuildDir.setToolTip(Tr::tr("Qmake has subtle bugs that "
"can be triggered if source and build directory are not at the same level."));
registerAspect(&alwaysRunQmake);
alwaysRunQmake.setSettingsKey("AlwaysRunQmake");
alwaysRunQmake.setLabelText(Tr::tr("Run qmake on every build"));
alwaysRunQmake.setToolTip(Tr::tr("This option can help to prevent failures on "
"incremental builds, but might slow them down unnecessarily in the general case."));
registerAspect(&ignoreSystemFunction);
ignoreSystemFunction.setSettingsKey("RunSystemFunction");
ignoreSystemFunction.setLabelText(Tr::tr("Ignore qmake's system() function when parsing a project"));
ignoreSystemFunction.setToolTip(Tr::tr("Checking this option avoids unwanted side effects, "

View File

@@ -14,9 +14,9 @@ public:
bool runSystemFunction() { return !ignoreSystemFunction(); }
Utils::BoolAspect warnAgainstUnalignedBuildDir;
Utils::BoolAspect alwaysRunQmake;
Utils::BoolAspect ignoreSystemFunction;
Utils::BoolAspect warnAgainstUnalignedBuildDir{this};
Utils::BoolAspect alwaysRunQmake{this};
Utils::BoolAspect ignoreSystemFunction{this};
};
QmakeSettings &settings();