From 782dbf1c1cf7145cfdb43e59068e7b1ea51a4e45 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 26 Jun 2012 12:23:48 +0200 Subject: [PATCH] ProfileManager: Create the desktop profile as manual This allows our users to change/remove it. Task-number: QTCREATORBUG-7568 Change-Id: Ie004eb73ceb4a4c77882db037609af4a3f226081 Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/profilemanager.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/profilemanager.cpp b/src/plugins/projectexplorer/profilemanager.cpp index 17f28e79488..3cf294b592d 100644 --- a/src/plugins/projectexplorer/profilemanager.cpp +++ b/src/plugins/projectexplorer/profilemanager.cpp @@ -174,12 +174,6 @@ void ProfileManager::restoreProfiles() // Then auto create profiles: QList detectedSts; - Profile *defaultProfile = new Profile; // One profile using default values - defaultProfile->setDisplayName(tr("Desktop")); - defaultProfile->setAutoDetected(true); - defaultProfile->setIconPath(QLatin1String(":///DESKTOP///")); - - detectedSts << defaultProfile; // Find/update autodetected profiles: Profile *toStore = 0; @@ -201,10 +195,19 @@ void ProfileManager::restoreProfiles() // Delete all loaded autodetected profiles that were not rediscovered: qDeleteAll(stsToCheck); - // Store manual tool chains + // Store manual profiles foreach (Profile *p, stsToRegister) addProfile(p); + if (profiles().isEmpty()) { + Profile *defaultProfile = new Profile; // One profile using default values + defaultProfile->setDisplayName(tr("Desktop")); + defaultProfile->setAutoDetected(false); + defaultProfile->setIconPath(QLatin1String(":///DESKTOP///")); + + addProfile(defaultProfile); + } + Profile *p = find(userProfiles.defaultProfile); if (p) setDefaultProfile(p);