From: Jerome St-Louis Date: Thu, 4 Aug 2016 19:06:46 +0000 (-0400) Subject: ide/settings: Importing user settings even if global new settings exist X-Git-Tag: 0.44.15~2 X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=497b2fe565bb56f7442e9f83d0dccb23740c0fd8 ide/settings: Importing user settings even if global new settings exist --- diff --git a/ecere/src/sys/GlobalAppSettings.ec b/ecere/src/sys/GlobalAppSettings.ec index e934e87..f152495 100644 --- a/ecere/src/sys/GlobalAppSettings.ec +++ b/ecere/src/sys/GlobalAppSettings.ec @@ -377,6 +377,8 @@ private: public: virtual void OnAskReloadSettings(); + property bool isGlobalPath { get { return globalPath; } } + bool OpenAndLock(FileSize * fileSize) { SettingsLocationType type = readType; diff --git a/ide/src/IDESettings.ec b/ide/src/IDESettings.ec index 0028ce5..11241cb 100644 --- a/ide/src/IDESettings.ec +++ b/ide/src/IDESettings.ec @@ -645,11 +645,25 @@ private: result = GlobalSettings::Load(); data = (IDESettings)this.data; oldConfig = false; - if(result == fileNotFound) + if(result == fileNotFound || (settingsFilePath && isGlobalPath)) { + bool retryNewConfig = settingsFilePath && isGlobalPath; oldConfig = true; useNewConfigurationFiles = false; - result = GlobalSettings::Load(); + if(retryNewConfig) + { + settingsFilePath = null; + CloseAndMonitor(); + } + + GlobalSettings::Load(); + + if(result == fileNotFound && retryNewConfig) + { + oldConfig = false; + useNewConfigurationFiles = true; + result = GlobalSettings::Load(); + } } data = (IDESettings)this.data; if(!data)