ecere/GlobalAppSettings: Made Load/Save virtual as they should have been; ide: Update...
authorJerome St-Louis <jerome@ecere.com>
Wed, 1 May 2013 02:27:57 +0000 (22:27 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 1 May 2013 02:27:57 +0000 (22:27 -0400)
ecere/src/sys/GlobalAppSettings.ec
ide/src/IDESettings.ec
ide/src/OldIDESettings.ec

index 51ef0d1..e5c4fcc 100644 (file)
@@ -325,7 +325,7 @@ private:
 public:
    virtual void OnAskReloadSettings();
 
-   SettingsIOResult Load()
+   virtual SettingsIOResult Load()
    {
       SettingsIOResult result = fileNotFound;
       if(!f)
@@ -389,7 +389,7 @@ public:
       return result;
    }
 
-   SettingsIOResult Save()
+   virtual SettingsIOResult Save()
    {
       SettingsIOResult result = error;
       if(!f)
index b23398d..f3ec35e 100644 (file)
@@ -216,8 +216,8 @@ private:
          Load();
       }
    }
-   // These must be public as they are not virtual
-   public SettingsIOResult Load()
+
+   SettingsIOResult Load()
    {
       SettingsIOResult result = GlobalSettings::Load();
       IDESettings data = (IDESettings)this.data;
@@ -298,18 +298,22 @@ private:
       return result;
    }
 
-   public void Save()
+   SettingsIOResult Save()
    {
+      SettingsIOResult result;
+
       IDESettings data = (IDESettings)this.data;
       Platform runtimePlatform = GetRuntimePlatform();
       if(portable && moduleLocation[0] && FileExists(moduleLocation).isDirectory)
          data.ManagePortablePaths(moduleLocation, false);
       data.ForcePathSeparatorStyle(true);
-      if(!GlobalSettings::Save())
+      result = GlobalSettings::Save();
+      if(result != success)
          PrintLn("Error saving IDE settings");
       if(portable && moduleLocation[0] && FileExists(moduleLocation).isDirectory)
          data.ManagePortablePaths(moduleLocation, true);
       CloseAndMonitor();
+      return result;
    }
 }
 
index 39a58e0..db9d84c 100644 (file)
@@ -115,8 +115,7 @@ class OldIDESettings : GlobalAppSettings
       }
    }
 
-   // These must be public as they are not virtual
-   public SettingsIOResult Load()
+   SettingsIOResult Load()
    {
       SettingsIOResult result = GlobalAppSettings::Load();
       if(result == success)
@@ -214,9 +213,10 @@ class OldIDESettings : GlobalAppSettings
       return result;
    }
 
-   public void Save()
+   SettingsIOResult Save()
    {
-      if(GlobalAppSettings::Save())
+      SettingsIOResult result = GlobalAppSettings::Save();
+      if(result == success)
       {
          Array<String> configNames { };
          CompilerConfig compiler = compilerConfigs.firstIterator.data;
@@ -278,5 +278,6 @@ class OldIDESettings : GlobalAppSettings
          
          CloseAndMonitor();
       }
+      return result;
    }
 }