[Kst] branches/work/kst/kst1kde4/kst/src/libkstmath
Zongyi Zhang
freebody.kst at gmail.com
Tue Apr 13 01:22:37 CEST 2010
SVN commit 1114192 by zhang:
replace kconfig with qsettings
M +27 -27 kstobjectdefaults.cpp
M +3 -2 kstobjectdefaults.h
M +4 -4 kstsettings.cpp
--- branches/work/kst/kst1kde4/kst/src/libkstmath/kstobjectdefaults.cpp #1114191:1114192
@@ -19,7 +19,7 @@
#include "kstdataobjectcollection.h"
#include "kstpsd.h"
-#include <kconfig.h>
+#include <QSettings>
KstObjectDefaults KST::objectDefaults;
@@ -73,33 +73,33 @@
}
-void KstObjectDefaults::writeConfig(KConfig *config) {
- /* xxx
- config->writeEntry("defaultFFTLen", KST::objectDefaults.fftLen());
- config->writeEntry("defaultPSDFreq", KST::objectDefaults.psdFreq());
- config->writeEntry("defaultVUnits", KST::objectDefaults.vUnits());
- config->writeEntry("defaultRUnits", KST::objectDefaults.rUnits());
- config->writeEntry("defaultApodize", KST::objectDefaults.apodize());
- config->writeEntry("defaultRemoveMean", KST::objectDefaults.removeMean());
- config->writeEntry("defaultPSDAverage", KST::objectDefaults.psdAverage());
- config->writeEntry("defaultApodizeFxn", KST::objectDefaults.apodizeFxn());
- config->writeEntry("defaultOutput", KST::objectDefaults.output());
- config->writeEntry("defaultInterpolateHoles", KST::objectDefaults.interpolateHoles());
-*/
+void KstObjectDefaults::writeConfig(QSettings *config) {
+
+ config->setValue("defaultFFTLen", KST::objectDefaults.fftLen());
+ config->setValue("defaultPSDFreq", KST::objectDefaults.psdFreq());
+ config->setValue("defaultVUnits", KST::objectDefaults.vUnits());
+ config->setValue("defaultRUnits", KST::objectDefaults.rUnits());
+ config->setValue("defaultApodize", KST::objectDefaults.apodize());
+ config->setValue("defaultRemoveMean", KST::objectDefaults.removeMean());
+ config->setValue("defaultPSDAverage", KST::objectDefaults.psdAverage());
+ config->setValue("defaultApodizeFxn", KST::objectDefaults.apodizeFxn());
+ config->setValue("defaultOutput", KST::objectDefaults.output());
+ config->setValue("defaultInterpolateHoles", KST::objectDefaults.interpolateHoles());
+
}
-void KstObjectDefaults::readConfig(KConfig *config) {
-/* xxx
- _fft_len = config->readNumEntry("defaultFFTLen", 10);
- _psd_freq = config->readDoubleNumEntry("defaultPSDFreq", 100.0);
- _vUnits = config->readEntry("defaultVUnits", "V");
- _rUnits = config->readEntry("defaultRUnits", "Hz");
- _apodize = config->readNumEntry("defaultApodize", 1);
- _removeMean = config->readNumEntry("defaultRemoveMean", 1);
- _psd_average = config->readNumEntry("defaultPSDAverage", 1);
- _apodizeFxn = config->readNumEntry("defaultApodizeFxn", 0);
- _output = config->readNumEntry("defaultOutput", 0);
- _interpolateHoles = config->readBoolEntry("defaultInterpolateHoles", false);
-*/
+void KstObjectDefaults::readConfig(QSettings *config) {
+
+ _fft_len = config->value("defaultFFTLen", 10).toInt();
+ _psd_freq = config->value("defaultPSDFreq", 100.0).toDouble();
+ _vUnits = config->value("defaultVUnits", "V").toString();
+ _rUnits = config->value("defaultRUnits", "Hz").toString();
+ _apodize = config->value("defaultApodize", 1).toBool();
+ _removeMean = config->value("defaultRemoveMean", 1).toBool();
+ _psd_average = config->value("defaultPSDAverage", 1).toBool();
+ _apodizeFxn = config->value("defaultApodizeFxn", 0).toInt();
+ _output = config->value("defaultOutput", 0).toInt();
+ _interpolateHoles = config->value("defaultInterpolateHoles", false).toBool();
+
}
--- branches/work/kst/kst1kde4/kst/src/libkstmath/kstobjectdefaults.h #1114191:1114192
@@ -19,6 +19,7 @@
#define KSTOBJECTDEFAULTS_H
#include <QString>
+#include <QSettings>
#include "kst_export.h"
class KConfig;
@@ -39,8 +40,8 @@
int output() const { return _output; }
int interpolateHoles() const { return _interpolateHoles; }
- void readConfig(KConfig *config);
- void writeConfig(KConfig *config);
+ void readConfig(QSettings *config);
+ void writeConfig(QSettings *config);
private:
double _psd_freq;
--- branches/work/kst/kst1kde4/kst/src/libkstmath/kstsettings.cpp #1114191:1114192
@@ -20,7 +20,7 @@
#include <QSettings>
// include files for KDE
-#include <kconfig.h>
+// xxx #include <kconfig.h>
#include <kemailsettings.h>
#include "ksttimezones.h"
@@ -316,9 +316,9 @@
void KstSettings::checkUpdates() {
- KConfig cfg("kstrc");
- cfg.checkUpdate("kstautosave1.1", "kstautosave11.upd");
- cfg.checkUpdate("kstrcmisc1.1", "kstrcmisc11.upd");
+ QSettings cfg("kstrc");
+// xxx cfg.checkUpdate("kstautosave1.1", "kstautosave11.upd");
+// xxx cfg.checkUpdate("kstrcmisc1.1", "kstrcmisc11.upd");
}
More information about the Kst
mailing list