ide/settings: Importing user settings even if global new settings exist
[sdk] / ide / src / IDESettings.ec
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)