Use mkspec of the Qt version of qmake when matching profiles

In case the qmake-line does not contain a mkspec argument,
use the mkspec of the Qt version found by matching the
qmake binary.

This reduces the duplication of targets/profiles when opening
new projects.

Change-Id: I647e166ae0322fd093967abea760197cf4c7eedd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Daniel Teske
2012-07-16 17:14:55 +02:00
committed by Friedemann Kleint
parent 1be3ad29df
commit f43c02d12f

View File

@@ -331,15 +331,13 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
Utils::FileName parsedSpec = Utils::FileName parsedSpec =
Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, path.toString(), version); Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, path.toString(), version);
Utils::FileName versionSpec = version->mkspec(); Utils::FileName versionSpec = version->mkspec();
if (parsedSpec.isEmpty() || parsedSpec == Utils::FileName::fromString(QLatin1String("default")))
parsedSpec = versionSpec;
QString specArgument; QString specArgument;
// Compare mkspecs and add to additional arguments // Compare mkspecs and add to additional arguments
if (parsedSpec.isEmpty() || parsedSpec == versionSpec if (parsedSpec != versionSpec)
|| parsedSpec == Utils::FileName::fromString(QLatin1String("default"))) {
// using the default spec, don't modify additional arguments
} else {
specArgument = QLatin1String("-spec ") + Utils::QtcProcess::quoteArg(parsedSpec.toUserOutput()); specArgument = QLatin1String("-spec ") + Utils::QtcProcess::quoteArg(parsedSpec.toUserOutput());
}
Utils::QtcProcess::addArgs(&specArgument, additionalArguments); Utils::QtcProcess::addArgs(&specArgument, additionalArguments);
// Find profile: // Find profile: