QmakeProjectManager: Fix settings default value

Amends b569258748. The change dropped the special setup of
m_warnAgainstUnalignedBuildDir and fumbled when flipping the
the internal value for m_ignoreSystemFunction/m_runSystemFunction.

Almost back to the first patch: Keep the value under the name (and meaning)
"RunSystemFunction", but flip it for internal storage and user display.

Change-Id: I4e8cf430fd9ad922357b581b862b7e491c035977
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2021-03-30 18:19:02 +02:00
parent 1d04466628
commit e87e70dcf6

View File

@@ -42,7 +42,7 @@ QmakeSettings::QmakeSettings()
registerAspect(&m_warnAgainstUnalignedBuildDir);
m_warnAgainstUnalignedBuildDir.setSettingsKey("QmakeProjectManager/WarnAgainstUnalignedBuildDir");
m_warnAgainstUnalignedBuildDir.setDefaultValue(true);
m_warnAgainstUnalignedBuildDir.setDefaultValue(HostOsInfo::isWindowsHost());
m_warnAgainstUnalignedBuildDir.setLabelText(tr("Warn if a project's source and "
"build directories are not at the same level"));
m_warnAgainstUnalignedBuildDir.setToolTip(tr("Qmake has subtle bugs that "
@@ -59,6 +59,11 @@ QmakeSettings::QmakeSettings()
m_ignoreSystemFunction.setLabelText(tr("Ignore qmake's system() function when parsing a project"));
m_ignoreSystemFunction.setToolTip(tr("Checking this option avoids unwanted side effects, "
"but may result in inexact parsing results."));
// The settings value has been stored with the opposite meaning for a while.
// Avoid changing the stored value, but flip it on read/write:
const auto invertBoolVariant = [](const QVariant &v) { return QVariant(!v.toBool()); };
m_ignoreSystemFunction.setFromSettingsTransformation(invertBoolVariant);
m_ignoreSystemFunction.setToSettingsTransformation(invertBoolVariant);
readSettings(Core::ICore::settings());
}