diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 4079b0ef56b..19bfdc27b0a 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -313,22 +313,20 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor if (tcCxx) cxxCompilerPath = tcCxx->compilerCommand(); - const QFileInfo cFileInfo = cCompilerPath.toFileInfo(); - const QFileInfo cxxFileInfo = cxxCompilerPath.toFileInfo(); - QString cCompilerName = cFileInfo.fileName(); - QString cxxCompilerName = cxxFileInfo.fileName(); + QString cCompilerName = cCompilerPath.fileName(); + QString cxxCompilerName = cxxCompilerPath.fileName(); const QString cToolchainPrefix = extractToolchainPrefix(&cCompilerName); const QString cxxToolchainPrefix = extractToolchainPrefix(&cxxCompilerName); - QFileInfo mainFileInfo; + Utils::FilePath mainFilePath; QString mainCompilerName; QString mainToolchainPrefix; if (tcCxx) { - mainFileInfo = cxxFileInfo; + mainFilePath = cxxCompilerPath; mainCompilerName = cxxCompilerName; mainToolchainPrefix = cxxToolchainPrefix; } else { - mainFileInfo = cFileInfo; + mainFilePath = cCompilerPath; mainCompilerName = cCompilerName; mainToolchainPrefix = cToolchainPrefix; } @@ -353,11 +351,11 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor } if (tcC && tcCxx && !cCompilerPath.isEmpty() && !cxxCompilerPath.isEmpty() - && cFileInfo.absolutePath() != cxxFileInfo.absolutePath()) { + && cCompilerPath.absolutePath() != cxxCompilerPath.absolutePath()) { Core::MessageManager::writeFlashing( tr("C and C++ compiler paths differ. C compiler may not work.")); } - data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFileInfo.absolutePath()); + data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFilePath.absolutePath().toString()); if (auto gcc = dynamic_cast(mainTc)) { QStringList compilerFlags = gcc->platformCodeGenFlags(); @@ -372,7 +370,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor // Reverse engineer the Xcode developer path from the compiler path const QRegularExpression compilerRe( QStringLiteral("^(?.*)/Toolchains/(?:.+)\\.xctoolchain/usr/bin$")); - const QRegularExpressionMatch compilerReMatch = compilerRe.match(cxxFileInfo.absolutePath()); + const QRegularExpressionMatch compilerReMatch = compilerRe.match(cxxCompilerPath.absolutePath().toString()); if (compilerReMatch.hasMatch()) { const QString developerPath = compilerReMatch.captured(QStringLiteral("developerpath")); data.insert(QLatin1String(XCODE_DEVELOPERPATH), developerPath);