Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11600/src/classes

Modified Files:
        ConfigSourcesAll.cpp 
Log Message:
write to last (global) config source by default and not the local one; but 
write some specific persistent controls settings to the local one

Index: ConfigSourcesAll.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/ConfigSourcesAll.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -b -u -2 -r1.5 -r1.6
--- ConfigSourcesAll.cpp        5 Jul 2005 21:35:03 -0000       1.5
+++ ConfigSourcesAll.cpp        6 Jul 2005 11:28:48 -0000       1.6
@@ -26,4 +26,6 @@
 #endif // USE_PCH
 
+#include <wx/persctrl.h>
+
 #include "ConfigSourcesAll.h"
 #include "ConfigSourceLocal.h"
@@ -247,5 +249,21 @@
    bool DoWrite(LookupData& ld)
    {
-      return m_configSources.Write(m_path, ld, NULL /* use local config */);
+      // most of the persistent controls settings can be shared between the
+      // installations and so can be written to the global config source, but
+      // some of them only make sense for this machine and should be written to
+      // the local config source
+      ConfigSource *config;
+      if ( m_path.StartsWith(M_FRAMES_CONFIG_SECTION) ||
+               m_path.StartsWith(_T("/") M_SETTINGS_CONFIG_SECTION +
+                                    wxPSplitterWindow::GetConfigPath()) )
+      {
+         config = *m_configSources.GetSources().begin().operator->();
+      }
+      else // can be shared
+      {
+         config = NULL;
+      }
+
+      return m_configSources.Write(m_path, ld, config);
    }
 
@@ -449,15 +467,6 @@
                _T("can't write to profile if no config sources exist") );
 
-      config = *m_sources.begin().operator->();
-
-      // avoid writing to local config source the same data that are already
-      // present in another one with lesser priority: this just results in huge
-      // duplication of data without any gain
-      LookupData dataOld(data);
-      if ( Read(path, dataOld) && dataOld == data )
-      {
-         // the same value already present, don't write it
-         return true;
-      }
+      List::iterator i = m_sources.end();
+      config = *((--i).operator->());
    }
 



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to