ide/settings: Importing user settings even if global new settings exist
authorJerome St-Louis <jerome@ecere.com>
Thu, 4 Aug 2016 19:06:46 +0000 (15:06 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 4 Aug 2016 19:33:03 +0000 (15:33 -0400)
ecere/src/sys/GlobalAppSettings.ec
ide/src/IDESettings.ec

index e934e87..f152495 100644 (file)
@@ -377,6 +377,8 @@ private:
 public:
    virtual void OnAskReloadSettings();
 
+   property bool isGlobalPath { get { return globalPath; } }
+
    bool OpenAndLock(FileSize * fileSize)
    {
       SettingsLocationType type = readType;
index 0028ce5..11241cb 100644 (file)
@@ -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)