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

Mike Fenton mike at staikos.net
Wed Nov 21 20:51:05 CET 2007


SVN commit 739749 by fenton:

Cleanup Kst references inside of Kst namespace.


 M  +14 -14    libkst/dialogdefaults.cpp  
 M  +21 -21    libkstapp/datawizard.cpp  
 M  +15 -15    libkstapp/vectordialog.cpp  


--- branches/work/kst/portto4/kst/src/libkst/dialogdefaults.cpp #739748:739749
@@ -12,24 +12,24 @@
 #include "dialogdefaults.h"
 namespace Kst {
   QSettings *dialogDefaults = new QSettings("kstdialogrc", QSettings::NativeFormat);
-}
 
-void Kst::setDataVectorDefaults(DataVectorPtr V) {
+void setDataVectorDefaults(DataVectorPtr V) {
   //FIXME Do we need a V->readLock() here?
-  Kst::dialogDefaults->setValue("vector/datasource", V->filename());
-  Kst::dialogDefaults->setValue("vector/range", V->reqNumFrames());
-  Kst::dialogDefaults->setValue("vector/start", V->reqStartFrame());
-  Kst::dialogDefaults->setValue("vector/countFromEnd", V->countFromEOF());
-  Kst::dialogDefaults->setValue("vector/readToEnd", V->readToEOF());
-  Kst::dialogDefaults->setValue("vector/skip", V->skip());
-  Kst::dialogDefaults->setValue("vector/doSkip", V->doSkip());
-  Kst::dialogDefaults->setValue("vector/doAve", V->doAve());
+  dialogDefaults->setValue("vector/datasource", V->filename());
+  dialogDefaults->setValue("vector/range", V->reqNumFrames());
+  dialogDefaults->setValue("vector/start", V->reqStartFrame());
+  dialogDefaults->setValue("vector/countFromEnd", V->countFromEOF());
+  dialogDefaults->setValue("vector/readToEnd", V->readToEOF());
+  dialogDefaults->setValue("vector/skip", V->skip());
+  dialogDefaults->setValue("vector/doSkip", V->doSkip());
+  dialogDefaults->setValue("vector/doAve", V->doAve());
 }
 
-void Kst::setGenVectorDefaults(GeneratedVectorPtr V) {
+void setGenVectorDefaults(GeneratedVectorPtr V) {
   //FIXME Do we need a V->readLock() here? 
-  Kst::dialogDefaults->setValue("genVector/min", V->min());
-  Kst::dialogDefaults->setValue("genVector/max", V->max()); 
-  Kst::dialogDefaults->setValue("genVector/length", V->length());
+  dialogDefaults->setValue("genVector/min", V->min());
+  dialogDefaults->setValue("genVector/max", V->max()); 
+  dialogDefaults->setValue("genVector/length", V->length());
 }
 
+}
--- branches/work/kst/portto4/kst/src/libkstapp/datawizard.cpp #739748:739749
@@ -39,7 +39,7 @@
    connect(_url, SIGNAL(changed(const QString&)), this, SLOT(sourceChanged(const QString&)));
    connect(_configureSource, SIGNAL(clicked()), this, SLOT(configureSource()));
 
-   QString default_source = Kst::dialogDefaults->value("vector/datasource",".").toString();
+   QString default_source = dialogDefaults->value("vector/datasource",".").toString();
   _url->setFile(default_source);
   _url->setFocus();
   //sourceChanged(default_source);
@@ -369,25 +369,25 @@
 
   _xVectorExisting->setObjectStore(store);
 
-  dataRange()->setRange(Kst::dialogDefaults->value("vector/range", 1).toInt());
-  dataRange()->setStart(Kst::dialogDefaults->value("vector/start", 0).toInt());
-  dataRange()->setCountFromEnd(Kst::dialogDefaults->value("vector/countFromEnd",false).toBool());
-  dataRange()->setReadToEnd(Kst::dialogDefaults->value("vector/readToEnd",true).toBool());
-  dataRange()->setSkip(Kst::dialogDefaults->value("vector/skip", 0).toInt());
-  dataRange()->setDoSkip(Kst::dialogDefaults->value("vector/doSkip", false).toBool());
-  dataRange()->setDoFilter(Kst::dialogDefaults->value("vector/doAve",false).toBool());
+  dataRange()->setRange(dialogDefaults->value("vector/range", 1).toInt());
+  dataRange()->setStart(dialogDefaults->value("vector/start", 0).toInt());
+  dataRange()->setCountFromEnd(dialogDefaults->value("vector/countFromEnd",false).toBool());
+  dataRange()->setReadToEnd(dialogDefaults->value("vector/readToEnd",true).toBool());
+  dataRange()->setSkip(dialogDefaults->value("vector/skip", 0).toInt());
+  dataRange()->setDoSkip(dialogDefaults->value("vector/doSkip", false).toBool());
+  dataRange()->setDoFilter(dialogDefaults->value("vector/doAve",false).toBool());
 
-  getFFTOptions()->setSampleRate(Kst::dialogDefaults->value("spectrum/freq",100.0).toDouble());
-  getFFTOptions()->setInterleavedAverage(Kst::dialogDefaults->value("spectrum/average",true).toBool());
-  getFFTOptions()->setFFTLength(Kst::dialogDefaults->value("spectrum/len",12).toInt());
-  getFFTOptions()->setApodize(Kst::dialogDefaults->value("spectrum/apodize",true).toBool());
-  getFFTOptions()->setRemoveMean(Kst::dialogDefaults->value("spectrum/removeMean",true).toBool());
-  getFFTOptions()->setVectorUnits(Kst::dialogDefaults->value("spectrum/vUnits","V").toString());
-  getFFTOptions()->setRateUnits(Kst::dialogDefaults->value("spectrum/rUnits","Hz").toString());
-  getFFTOptions()->setApodizeFunction(ApodizeFunction(Kst::dialogDefaults->value("spectrum/apodizeFxn",WindowOriginal).toInt()));
-  getFFTOptions()->setSigma(Kst::dialogDefaults->value("spectrum/gaussianSigma",1.0).toDouble());
-  getFFTOptions()->setOutput(PSDType(Kst::dialogDefaults->value("spectrum/output",PSDPowerSpectralDensity).toInt()));
-  getFFTOptions()->setInterpolateOverHoles(Kst::dialogDefaults->value("spectrum/interpolateHoles",true).toInt());
+  getFFTOptions()->setSampleRate(dialogDefaults->value("spectrum/freq",100.0).toDouble());
+  getFFTOptions()->setInterleavedAverage(dialogDefaults->value("spectrum/average",true).toBool());
+  getFFTOptions()->setFFTLength(dialogDefaults->value("spectrum/len",12).toInt());
+  getFFTOptions()->setApodize(dialogDefaults->value("spectrum/apodize",true).toBool());
+  getFFTOptions()->setRemoveMean(dialogDefaults->value("spectrum/removeMean",true).toBool());
+  getFFTOptions()->setVectorUnits(dialogDefaults->value("spectrum/vUnits","V").toString());
+  getFFTOptions()->setRateUnits(dialogDefaults->value("spectrum/rUnits","Hz").toString());
+  getFFTOptions()->setApodizeFunction(ApodizeFunction(dialogDefaults->value("spectrum/apodizeFxn",WindowOriginal).toInt()));
+  getFFTOptions()->setSigma(dialogDefaults->value("spectrum/gaussianSigma",1.0).toDouble());
+  getFFTOptions()->setOutput(PSDType(dialogDefaults->value("spectrum/output",PSDPowerSpectralDensity).toInt()));
+  getFFTOptions()->setInterpolateOverHoles(dialogDefaults->value("spectrum/interpolateHoles",true).toInt());
 
 
   connect(_radioButtonPlotData, SIGNAL(clicked()), this, SLOT(updatePlotTypeOptions()));
@@ -537,7 +537,7 @@
   connect(button(QWizard::FinishButton), SIGNAL(clicked()), this, SLOT(finished()));
 
   // the dialog needs to know that the default has been set....
-  _pageDataSource->sourceChanged(Kst::dialogDefaults->value("vector/datasource",".").toString());
+  _pageDataSource->sourceChanged(dialogDefaults->value("vector/datasource",".").toString());
 
 }
 
@@ -681,7 +681,7 @@
       ++n_curves;
     }
     if (n_curves>0) {
-      Kst::setDataVectorDefaults(vector);
+      setDataVectorDefaults(vector);
     }
   }
 
--- branches/work/kst/portto4/kst/src/libkstapp/vectordialog.cpp #739748:739749
@@ -254,17 +254,17 @@
 
 void VectorDialog::configureTab(ObjectPtr vector) {
   if (!vector) {
-    _vectorTab->setFile(Kst::dialogDefaults->value("vector/datasource",_vectorTab->file()).toString());
-    _vectorTab->dataRange()->setRange(Kst::dialogDefaults->value("vector/range", 1).toInt());
-    _vectorTab->dataRange()->setStart(Kst::dialogDefaults->value("vector/start", 0).toInt());
-    _vectorTab->dataRange()->setCountFromEnd(Kst::dialogDefaults->value("vector/countFromEnd",false).toBool());
-    _vectorTab->dataRange()->setReadToEnd(Kst::dialogDefaults->value("vector/readToEnd",true).toBool());
-    _vectorTab->dataRange()->setSkip(Kst::dialogDefaults->value("vector/skip", 0).toInt());
-    _vectorTab->dataRange()->setDoSkip(Kst::dialogDefaults->value("vector/doSkip", false).toBool());
-    _vectorTab->dataRange()->setDoFilter(Kst::dialogDefaults->value("vector/doAve",false).toBool());
-    _vectorTab->setFrom(Kst::dialogDefaults->value("genVector/min",-10).toInt());
-    _vectorTab->setTo(Kst::dialogDefaults->value("genVector/max",10).toInt());
-    _vectorTab->setNumberOfSamples(Kst::dialogDefaults->value("genVector/length",1000).toInt());
+    _vectorTab->setFile(dialogDefaults->value("vector/datasource",_vectorTab->file()).toString());
+    _vectorTab->dataRange()->setRange(dialogDefaults->value("vector/range", 1).toInt());
+    _vectorTab->dataRange()->setStart(dialogDefaults->value("vector/start", 0).toInt());
+    _vectorTab->dataRange()->setCountFromEnd(dialogDefaults->value("vector/countFromEnd",false).toBool());
+    _vectorTab->dataRange()->setReadToEnd(dialogDefaults->value("vector/readToEnd",true).toBool());
+    _vectorTab->dataRange()->setSkip(dialogDefaults->value("vector/skip", 0).toInt());
+    _vectorTab->dataRange()->setDoSkip(dialogDefaults->value("vector/doSkip", false).toBool());
+    _vectorTab->dataRange()->setDoFilter(dialogDefaults->value("vector/doAve",false).toBool());
+    _vectorTab->setFrom(dialogDefaults->value("genVector/min",-10).toInt());
+    _vectorTab->setTo(dialogDefaults->value("genVector/max",10).toInt());
+    _vectorTab->setNumberOfSamples(dialogDefaults->value("genVector/length",1000).toInt());
   } else if (DataVectorPtr dataVector = kst_cast<DataVector>(vector)) {
     _vectorTab->setVectorMode(VectorTab::DataVector);
     _vectorTab->setFile(dataVector->dataSource()->fileName());
@@ -335,7 +335,7 @@
       dataRange->doSkip(),
       dataRange->doFilter());
 
-  Kst::setDataVectorDefaults(vector);
+  setDataVectorDefaults(vector);
 
 #if 0
   DataVectorPtr vector = new DataVector(
@@ -373,7 +373,7 @@
   GeneratedVectorPtr vector = _document->objectStore()->createObject<GeneratedVector>(tag);
   vector->changeRange(from, to, numberOfSamples);
 
-  Kst::setGenVectorDefaults(vector);
+  setGenVectorDefaults(vector);
 
 //  return static_cast<ObjectPtr>(vector);
   return vector;
@@ -401,7 +401,7 @@
     dataVector->update(0);
     dataVector->unlock();
 
-    Kst::setDataVectorDefaults(dataVector);
+    setDataVectorDefaults(dataVector);
 
   } else if (GeneratedVectorPtr generatedVector = kst_cast<GeneratedVector>(dataObject())) {
     const qreal from = _vectorTab->from();
@@ -410,7 +410,7 @@
     generatedVector->writeLock();
     generatedVector->changeRange(from, to, numberOfSamples);
     generatedVector->unlock();
-    Kst::setGenVectorDefaults(generatedVector);
+    setGenVectorDefaults(generatedVector);
   }
   return dataObject();
 }


More information about the Kst mailing list