Utils: Make FilePathAspect::setDefaultValue take a QString

This sets the unexpanded value, so going to a "cooked" FilePath can
at least theoretically break. On the user side it saves a
roundtrip in a few cases, but is more ugly when the input is already
a proper FilePath.

Change-Id: I8a7e8f6d46fcc34c96b55e41d656dca933fbef4e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-08-17 12:51:13 +02:00
parent 3fa4fa5cf3
commit ec7abcf98c
14 changed files with 23 additions and 22 deletions

View File

@@ -44,10 +44,10 @@ CppcheckSettings::CppcheckSettings()
if (HostOsInfo::isAnyUnixHost()) {
binary.setDefaultValue("cppcheck");
} else {
FilePath programFiles = FilePath::fromUserInput(qtcEnvironmentVariable("PROGRAMFILES"));
QString programFiles = qtcEnvironmentVariable("PROGRAMFILES");
if (programFiles.isEmpty())
programFiles = "C:/Program Files";
binary.setDefaultValue(programFiles.pathAppended("Cppcheck/cppcheck.exe"));
binary.setDefaultValue(programFiles + "/Cppcheck/cppcheck.exe");
}
warning.setSettingsKey("warning");