QbsProjectManager: Use the same build key as in previous versions

We changed the build key derivation method in commit 6913947986 under
the assumption that it doesn't really matter as long as it's unique.
However, this value gets serialized, so the change broke restoring
existing qbs run configurations.
As we don't want users to lose all their run configs when upgrading to
4.12, we switch back to the old pattern.

Change-Id: Ia4a353af08cca33dbc3c60bd9fc0e28f42dcfe20
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-02-18 15:07:53 +01:00
parent f65f260c91
commit 61932b5d4b

View File

@@ -1069,12 +1069,13 @@ void QbsBuildSystem::updateApplicationTargets()
} }
} }
BuildTargetInfo bti; BuildTargetInfo bti;
bti.buildKey = productData.value("full-display-name").toString(); bti.buildKey = productData.value("name").toString() + '.'
+ productData.value("multiplex-configuration-id").toString();
bti.targetFilePath = FilePath::fromString(targetFile); bti.targetFilePath = FilePath::fromString(targetFile);
bti.projectFilePath = FilePath::fromString(projectFile); bti.projectFilePath = FilePath::fromString(projectFile);
bti.isQtcRunnable = isQtcRunnable; // Fixed up below. bti.isQtcRunnable = isQtcRunnable; // Fixed up below.
bti.usesTerminal = usesTerminal; bti.usesTerminal = usesTerminal;
bti.displayName = bti.buildKey; bti.displayName = productData.value("full-display-name").toString();
bti.runEnvModifier = [targetFile, productData, this](Utils::Environment &env, bool usingLibraryPaths) { bti.runEnvModifier = [targetFile, productData, this](Utils::Environment &env, bool usingLibraryPaths) {
const QString productName = productData.value("full-display-name").toString(); const QString productName = productData.value("full-display-name").toString();
if (session()->projectData().isEmpty()) if (session()->projectData().isEmpty())