[Kst] branches/work/kst/portto4/kst/src/libkst

Adam Treat treat at kde.org
Tue Jul 3 17:46:16 CEST 2007


SVN commit 682876 by treat:

* More removal of KConfig


 M  +0 -1      kstdatasource.h  
 M  +19 -19    kstmatrixdefaults.cpp  
 M  +3 -3      kstmatrixdefaults.h  
 M  +17 -17    kstvectordefaults.cpp  
 M  +3 -3      kstvectordefaults.h  


--- branches/work/kst/portto4/kst/src/libkst/kstdatasource.h #682875:682876
@@ -25,7 +25,6 @@
 #include <qtextstream.h>
 #include <qwidget.h>
 
-#include <kconfig.h>
 #include <qsettings.h>
 
 #include "kstdateparser.h"
--- branches/work/kst/portto4/kst/src/libkst/kstmatrixdefaults.cpp #682875:682876
@@ -20,7 +20,7 @@
 #include "kstrmatrix.h"
 #include "stdinsource.h"
 
-#include <kconfiggroup.h>
+#include <qsettings.h>
 
 KstMatrixDefaults KST::matrixDefaults;
 
@@ -129,27 +129,27 @@
   }
 }
 
-void KstMatrixDefaults::writeConfig(KConfigGroup *config) {
-  config->writeEntry("defaultMatrixDataSource", KST::matrixDefaults.dataSource());
-  config->writeEntry("defaultXStart", KST::matrixDefaults.xStart());
-  config->writeEntry("defaultYStart", KST::matrixDefaults.yStart());
-  config->writeEntry("defaultXNumSteps", KST::matrixDefaults.xNumSteps());
-  config->writeEntry("defaultYNumSteps", KST::matrixDefaults.yNumSteps());
-  config->writeEntry("defaultMatrixDoSkip", KST::matrixDefaults.doSkip());
-  config->writeEntry("defaultMatrixDoAverage", KST::matrixDefaults.doAverage());
-  config->writeEntry("defaultMatrixSkip", KST::matrixDefaults.skip());
+void KstMatrixDefaults::writeConfig(QSettings *config) {
+  config->setValue("defaultMatrixDataSource", KST::matrixDefaults.dataSource());
+  config->setValue("defaultXStart", KST::matrixDefaults.xStart());
+  config->setValue("defaultYStart", KST::matrixDefaults.yStart());
+  config->setValue("defaultXNumSteps", KST::matrixDefaults.xNumSteps());
+  config->setValue("defaultYNumSteps", KST::matrixDefaults.yNumSteps());
+  config->setValue("defaultMatrixDoSkip", KST::matrixDefaults.doSkip());
+  config->setValue("defaultMatrixDoAverage", KST::matrixDefaults.doAverage());
+  config->setValue("defaultMatrixSkip", KST::matrixDefaults.skip());
 }
 
 
-void KstMatrixDefaults::readConfig(KConfigGroup *config) {
-  _dataSource = config->readEntry("defaultMatrixDataSource", ".");
-  _xStart = config->readEntry("defaultXStart", 0);
-  _yStart = config->readEntry("defaultYStart", 0);
-  _xNumSteps = config->readEntry("defaultXNumSteps", -1);
-  _yNumSteps = config->readEntry("defaultYNumSteps", -1);
-  _doSkip = config->readEntry("defaultMatrixDoSkip", 0);
-  _doAve = config->readEntry("defaultMatrixDoAverage", 0);
-  _skip = config->readEntry("defaultMatrixSkip", 0);
+void KstMatrixDefaults::readConfig(QSettings *config) {
+  _dataSource = config->value("defaultMatrixDataSource", ".").toString();
+  _xStart = config->value("defaultXStart", 0).toInt();
+  _yStart = config->value("defaultYStart", 0).toInt();
+  _xNumSteps = config->value("defaultXNumSteps", -1).toInt();
+  _yNumSteps = config->value("defaultYNumSteps", -1).toInt();
+  _doSkip = config->value("defaultMatrixDoSkip", 0).toInt();
+  _doAve = config->value("defaultMatrixDoAverage", 0).toInt();
+  _skip = config->value("defaultMatrixSkip", 0).toInt();
 }
 
 
--- branches/work/kst/portto4/kst/src/libkst/kstmatrixdefaults.h #682875:682876
@@ -21,7 +21,7 @@
 #include <qstring.h>
 #include "kst_export.h"
 
-class KConfigGroup;
+class QSettings;
 
 class KST_EXPORT KstMatrixDefaults {
   public:
@@ -29,8 +29,8 @@
     KstMatrixDefaults();
     // get last used settings and store them in this KstMatrixDefaults
     void sync();
-    void readConfig(KConfigGroup *config);
-    void writeConfig(KConfigGroup *config);
+    void readConfig(QSettings *config);
+    void writeConfig(QSettings *config);
     
     const QString& dataSource() const;
     int xStart() const;
--- branches/work/kst/portto4/kst/src/libkst/kstvectordefaults.cpp #682875:682876
@@ -20,7 +20,7 @@
 #include "kstdatacollection.h"
 #include "stdinsource.h"
 
-#include <kconfig.h>
+#include <qsettings.h>
 
 KstVectorDefaults KST::vectorDefaults;
 
@@ -109,25 +109,25 @@
 }
 
 
-void KstVectorDefaults::writeConfig(KConfigGroup *config) {
-  config->writeEntry("defaultDataSource", KST::vectorDefaults.dataSource());
-  config->writeEntry("defaultWizardXVector", KST::vectorDefaults.wizardXVector());
-  config->writeEntry("defaultStartFrame", KST::vectorDefaults.f0());
-  config->writeEntry("defaultNumFrames", KST::vectorDefaults.n());
-  config->writeEntry("defaultDoSkip", KST::vectorDefaults.doSkip());
-  config->writeEntry("defaultDoAve", KST::vectorDefaults.doAve());
-  config->writeEntry("defaultSkip", KST::vectorDefaults.skip());
+void KstVectorDefaults::writeConfig(QSettings *config) {
+  config->setValue("defaultDataSource", KST::vectorDefaults.dataSource());
+  config->setValue("defaultWizardXVector", KST::vectorDefaults.wizardXVector());
+  config->setValue("defaultStartFrame", KST::vectorDefaults.f0());
+  config->setValue("defaultNumFrames", KST::vectorDefaults.n());
+  config->setValue("defaultDoSkip", KST::vectorDefaults.doSkip());
+  config->setValue("defaultDoAve", KST::vectorDefaults.doAve());
+  config->setValue("defaultSkip", KST::vectorDefaults.skip());
 }
 
 
-void KstVectorDefaults::readConfig(KConfigGroup *config) {
-  _f0 = config->readEntry("defaultStartFrame", 0);
-  _n = config->readEntry("defaultNumFrames", -1);
-  _dataSource = config->readEntry("defaultDataSource", ".");
-  _wizardX = config->readEntry("defaultWizardXVector", "INDEX");
-  _doSkip = config->readEntry("defaultDoSkip", 0);
-  _doAve = config->readEntry("defaultDoAve", 0);
-  _skip = config->readEntry("defaultSkip", 0);
+void KstVectorDefaults::readConfig(QSettings *config) {
+  _f0 = config->value("defaultStartFrame", 0).toInt();
+  _n = config->value("defaultNumFrames", -1).toInt();
+  _dataSource = config->value("defaultDataSource", ".").toString();
+  _wizardX = config->value("defaultWizardXVector", "INDEX").toString();
+  _doSkip = config->value("defaultDoSkip", 0).toInt();
+  _doAve = config->value("defaultDoAve", 0).toInt();
+  _skip = config->value("defaultSkip", 0).toInt();
 }
 
 
--- branches/work/kst/portto4/kst/src/libkst/kstvectordefaults.h #682875:682876
@@ -21,7 +21,7 @@
 #include <qstring.h>
 #include "kst_export.h"
 
-class KConfigGroup;
+class QSettings;
 
 class KST_EXPORT KstVectorDefaults {
   public:
@@ -38,8 +38,8 @@
     bool doAve() const;
     int skip() const;
 
-    void readConfig(KConfigGroup *config);
-    void writeConfig(KConfigGroup *config);
+    void readConfig(QSettings *config);
+    void writeConfig(QSettings *config);
 
   private:
     QString _dataSource, _wizardX;


More information about the Kst mailing list