[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kdelibs4_snapshot/kdecore
From:       Adam Treat <treat () kde ! org>
Date:       2006-07-10 1:20:38
Message-ID: 1152494438.186789.26485.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 560327 by treat:

Apply 560326 to snapshot


 M  +25 -15    kconfigskeleton.cpp  
 M  +9 -13     kconfigskeleton.h  


--- branches/work/kdelibs4_snapshot/kdecore/kconfigskeleton.cpp #560326:560327
@@ -810,6 +810,28 @@
 
 bool KConfigSkeleton::useDefaults(bool b)
 {
+  return usrUseDefaults(b);
+}
+
+void KConfigSkeleton::setDefaults()
+{
+  usrSetDefaults();
+}
+
+void KConfigSkeleton::readConfig()
+{
+  kDebug(177) << "KConfigSkeleton::readConfig()" << endl;
+  usrReadConfig();
+}
+
+void KConfigSkeleton::writeConfig()
+{
+  kDebug(177) << "KConfigSkeleton::writeConfig()" << endl;
+  usrWriteConfig();
+}
+
+bool KConfigSkeleton::usrUseDefaults(bool b)
+{
   if (b == mUseDefaults)
      return mUseDefaults;
 
@@ -819,25 +841,19 @@
   {
     (*it)->swapDefault();
   }
-
-  usrUseDefaults(b);
   return !mUseDefaults;
 }
 
-void KConfigSkeleton::setDefaults()
+void KConfigSkeleton::usrSetDefaults()
 {
   KConfigSkeletonItem::List::ConstIterator it;
   for( it = mItems.begin(); it != mItems.end(); ++it ) {
     (*it)->setDefault();
   }
-
-  usrSetDefaults();
 }
 
-void KConfigSkeleton::readConfig()
+void KConfigSkeleton::usrReadConfig()
 {
-  kDebug(177) << "KConfigSkeleton::readConfig()" << endl;
-
   QString origGroup = mConfig->group();
 
   mConfig->reparseConfiguration();
@@ -847,15 +863,11 @@
     (*it)->readConfig( mConfig.data() );
   }
 
-  usrReadConfig();
-
   mConfig->setGroup(origGroup);
 }
 
-void KConfigSkeleton::writeConfig()
+void KConfigSkeleton::usrWriteConfig()
 {
-  kDebug(177) << "KConfigSkeleton::writeConfig()" << endl;
-
   QString origGroup = mConfig->group();
 
   KConfigSkeletonItem::List::ConstIterator it;
@@ -864,8 +876,6 @@
     (*it)->writeConfig( mConfig.data() );
   }
 
-  usrWriteConfig();
-
   mConfig->sync();
 
   readConfig();
--- branches/work/kdelibs4_snapshot/kdecore/kconfigskeleton.h #560326:560327
@@ -1299,29 +1299,25 @@
   /**
    * Implemented by subclasses that use special defaults.
    * It should replace the default values with the actual
-   * values and vice versa.
+   * values and vice versa.  Called from @ref useDefaults()
+   * @param b If true this object reflects the default values.
+   * @return The state prior to this call
    */
-  virtual void usrUseDefaults(bool)
-  {
-  }
+  virtual bool usrUseDefaults(bool b);
 
-  virtual void usrSetDefaults()
-  {
-  }
+  virtual void usrSetDefaults();
 
   /**
    * Implemented by subclasses that read special config values.
+   * Called from @ref readConfig()
    */
-  virtual void usrReadConfig()
-  {
-  }
+  virtual void usrReadConfig();
 
   /**
    * Implemented by subclasses that write special config values.
+   * Called from @ref writeConfig()
    */
-  virtual void usrWriteConfig()
-  {
-  }
+  virtual void usrWriteConfig();
 
 private:
   QString mCurrentGroup;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic