Utils: Use value/setValue instead of settings also for TriStateAspects

Change-Id: I3d0a58917cd6682e14894e4320d166a1c8de6a9a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-02-22 07:41:51 +01:00
parent f8a946ce96
commit c8829ff5b3
8 changed files with 42 additions and 37 deletions

View File

@@ -143,9 +143,9 @@ QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Utils::Id id)
if (!additionalArguments.isEmpty())
qmakeStep->setUserArguments(additionalArguments);
aspect<SeparateDebugInfoAspect>()->setSetting(qmakeExtra.config.separateDebugInfo);
aspect<QmlDebuggingAspect>()->setSetting(qmakeExtra.config.linkQmlDebuggingQQ2);
aspect<QtQuickCompilerAspect>()->setSetting(qmakeExtra.config.useQtQuickCompiler);
aspect<SeparateDebugInfoAspect>()->setValue(qmakeExtra.config.separateDebugInfo);
aspect<QmlDebuggingAspect>()->setValue(qmakeExtra.config.linkQmlDebuggingQQ2);
aspect<QtQuickCompilerAspect>()->setValue(qmakeExtra.config.useQtQuickCompiler);
setQMakeBuildConfiguration(config);
@@ -422,44 +422,43 @@ bool QmakeBuildConfiguration::isBuildDirAtSafeLocation() const
TriState QmakeBuildConfiguration::separateDebugInfo() const
{
return aspect<SeparateDebugInfoAspect>()->setting();
return aspect<SeparateDebugInfoAspect>()->value();
}
void QmakeBuildConfiguration::forceSeparateDebugInfo(bool sepDebugInfo)
{
aspect<SeparateDebugInfoAspect>()->setSetting(sepDebugInfo
? TriState::Enabled
: TriState::Disabled);
aspect<SeparateDebugInfoAspect>()->setValue(sepDebugInfo
? TriState::Enabled
: TriState::Disabled);
}
TriState QmakeBuildConfiguration::qmlDebugging() const
{
return aspect<QmlDebuggingAspect>()->setting();
return aspect<QmlDebuggingAspect>()->value();
}
void QmakeBuildConfiguration::forceQmlDebugging(bool enable)
{
aspect<QmlDebuggingAspect>()->setSetting(enable ? TriState::Enabled : TriState::Disabled);
aspect<QmlDebuggingAspect>()->setValue(enable ? TriState::Enabled : TriState::Disabled);
}
TriState QmakeBuildConfiguration::useQtQuickCompiler() const
{
return aspect<QtQuickCompilerAspect>()->setting();
return aspect<QtQuickCompilerAspect>()->value();
}
void QmakeBuildConfiguration::forceQtQuickCompiler(bool enable)
{
aspect<QtQuickCompilerAspect>()->setSetting(enable ? TriState::Enabled : TriState::Disabled);
aspect<QtQuickCompilerAspect>()->setValue(enable ? TriState::Enabled : TriState::Disabled);
}
bool QmakeBuildConfiguration::runSystemFunction() const
{
switch (aspect<RunSystemAspect>()->value()) {
case 0:
const TriState runSystem = aspect<RunSystemAspect>()->value();
if (runSystem == TriState::Enabled)
return true;
case 1:
if (runSystem == TriState::Disabled)
return false;
}
return QmakeSettings::runSystemFunction();
}