diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-25 16:49:51 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-25 13:04:16 -0800 |
commit | 2d9613956618105030611f7c785d7dbdd5c5c672 (patch) | |
tree | 134c6d07daf9b37244ce06ff194f83c74d8cead6 /subsurface-core | |
parent | 2c5fad73e8939409639548571dcb942e6b2cb792 (diff) | |
download | subsurface-2d9613956618105030611f7c785d7dbdd5c5c672.tar.gz |
Changed quite a few shorts to bool on the c++ implementtion
The shorts where being used on the preferences since a long
while and we cannot just simply change them to bool since this
could break the preferences files, so work around that by
changing them to booleans, since it's the correct type for a
true / false answer.
Also, move some plot curves to the new settings style
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core')
-rw-r--r-- | subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp | 72 | ||||
-rw-r--r-- | subsurface-core/subsurface-qt/SettingsObjectWrapper.h | 144 |
2 files changed, 108 insertions, 108 deletions
diff --git a/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp b/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp index 6c455e1c1..02ec8a0fc 100644 --- a/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp @@ -110,67 +110,67 @@ double TechnicalDetailsSettings:: modp02() const return prefs.modpO2; } -short TechnicalDetailsSettings::ead() const +bool TechnicalDetailsSettings::ead() const { return prefs.ead; } -short TechnicalDetailsSettings::dcceiling() const +bool TechnicalDetailsSettings::dcceiling() const { return prefs.dcceiling; } -short TechnicalDetailsSettings::redceiling() const +bool TechnicalDetailsSettings::redceiling() const { return prefs.redceiling; } -short TechnicalDetailsSettings::calcceiling() const +bool TechnicalDetailsSettings::calcceiling() const { return prefs.calcceiling; } -short TechnicalDetailsSettings::calcceiling3m() const +bool TechnicalDetailsSettings::calcceiling3m() const { return prefs.calcceiling3m; } -short TechnicalDetailsSettings::calcalltissues() const +bool TechnicalDetailsSettings::calcalltissues() const { return prefs.calcalltissues; } -short TechnicalDetailsSettings::calcndltts() const +bool TechnicalDetailsSettings::calcndltts() const { return prefs.calcndltts; } -short TechnicalDetailsSettings::gflow() const +bool TechnicalDetailsSettings::gflow() const { return prefs.gflow; } -short TechnicalDetailsSettings::gfhigh() const +bool TechnicalDetailsSettings::gfhigh() const { return prefs.gfhigh; } -short TechnicalDetailsSettings::hrgraph() const +bool TechnicalDetailsSettings::hrgraph() const { return prefs.hrgraph; } -short TechnicalDetailsSettings::tankBar() const +bool TechnicalDetailsSettings::tankBar() const { return prefs.tankbar; } -short TechnicalDetailsSettings::percentageGraph() const +bool TechnicalDetailsSettings::percentageGraph() const { return prefs.percentagegraph; } -short TechnicalDetailsSettings::rulerGraph() const +bool TechnicalDetailsSettings::rulerGraph() const { return prefs.rulergraph; } @@ -185,12 +185,12 @@ bool TechnicalDetailsSettings::showCCRSensors() const return prefs.show_ccr_sensors; } -short TechnicalDetailsSettings::zoomedPlot() const +bool TechnicalDetailsSettings::zoomedPlot() const { return prefs.zoomed_plot; } -short TechnicalDetailsSettings::showSac() const +bool TechnicalDetailsSettings::showSac() const { return prefs.show_sac; } @@ -200,17 +200,17 @@ bool TechnicalDetailsSettings::gfLowAtMaxDepth() const return prefs.gf_low_at_maxdepth; } -short TechnicalDetailsSettings::displayUnusedTanks() const +bool TechnicalDetailsSettings::displayUnusedTanks() const { return prefs.display_unused_tanks; } -short TechnicalDetailsSettings::showAverageDepth() const +bool TechnicalDetailsSettings::showAverageDepth() const { return prefs.show_average_depth; } -short int TechnicalDetailsSettings::mod() const +bool TechnicalDetailsSettings::mod() const { return prefs.mod; } @@ -238,7 +238,7 @@ void TechnicalDetailsSettings::setShowPicturesInProfile(bool value) emit showPicturesInProfileChanged(value); } -void TechnicalDetailsSettings::setEad(short value) +void TechnicalDetailsSettings::setEad(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -247,7 +247,7 @@ void TechnicalDetailsSettings::setEad(short value) emit eadChanged(value); } -void TechnicalDetailsSettings::setMod(short value) +void TechnicalDetailsSettings::setMod(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -256,7 +256,7 @@ void TechnicalDetailsSettings::setMod(short value) emit modChanged(value); } -void TechnicalDetailsSettings::setDCceiling(short value) +void TechnicalDetailsSettings::setDCceiling(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -265,7 +265,7 @@ void TechnicalDetailsSettings::setDCceiling(short value) emit dcceilingChanged(value); } -void TechnicalDetailsSettings::setRedceiling(short value) +void TechnicalDetailsSettings::setRedceiling(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -274,7 +274,7 @@ void TechnicalDetailsSettings::setRedceiling(short value) emit redceilingChanged(value); } -void TechnicalDetailsSettings::setCalcceiling(short value) +void TechnicalDetailsSettings::setCalcceiling(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -283,7 +283,7 @@ void TechnicalDetailsSettings::setCalcceiling(short value) emit calcceilingChanged(value); } -void TechnicalDetailsSettings::setCalcceiling3m(short value) +void TechnicalDetailsSettings::setCalcceiling3m(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -292,7 +292,7 @@ void TechnicalDetailsSettings::setCalcceiling3m(short value) emit calcceiling3mChanged(value); } -void TechnicalDetailsSettings::setCalcalltissues(short value) +void TechnicalDetailsSettings::setCalcalltissues(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -301,7 +301,7 @@ void TechnicalDetailsSettings::setCalcalltissues(short value) emit calcalltissuesChanged(value); } -void TechnicalDetailsSettings::setCalcndltts(short value) +void TechnicalDetailsSettings::setCalcndltts(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -310,7 +310,7 @@ void TechnicalDetailsSettings::setCalcndltts(short value) emit calcndlttsChanged(value); } -void TechnicalDetailsSettings::setGflow(short value) +void TechnicalDetailsSettings::setGflow(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -320,7 +320,7 @@ void TechnicalDetailsSettings::setGflow(short value) emit gflowChanged(value); } -void TechnicalDetailsSettings::setGfhigh(short value) +void TechnicalDetailsSettings::setGfhigh(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -330,7 +330,7 @@ void TechnicalDetailsSettings::setGfhigh(short value) emit gfhighChanged(value); } -void TechnicalDetailsSettings::setHRgraph(short value) +void TechnicalDetailsSettings::setHRgraph(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -339,7 +339,7 @@ void TechnicalDetailsSettings::setHRgraph(short value) emit hrgraphChanged(value); } -void TechnicalDetailsSettings::setTankBar(short value) +void TechnicalDetailsSettings::setTankBar(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -348,7 +348,7 @@ void TechnicalDetailsSettings::setTankBar(short value) emit tankBarChanged(value); } -void TechnicalDetailsSettings::setPercentageGraph(short value) +void TechnicalDetailsSettings::setPercentageGraph(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -357,7 +357,7 @@ void TechnicalDetailsSettings::setPercentageGraph(short value) emit percentageGraphChanged(value); } -void TechnicalDetailsSettings::setRulerGraph(short value) +void TechnicalDetailsSettings::setRulerGraph(bool value) { /* TODO: search for the QSettings of the RulerBar */ QSettings s; @@ -385,7 +385,7 @@ void TechnicalDetailsSettings::setShowCCRSensors(bool value) emit showCCRSensorsChanged(value); } -void TechnicalDetailsSettings::setZoomedPlot(short value) +void TechnicalDetailsSettings::setZoomedPlot(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -394,7 +394,7 @@ void TechnicalDetailsSettings::setZoomedPlot(short value) emit zoomedPlotChanged(value); } -void TechnicalDetailsSettings::setShowSac(short value) +void TechnicalDetailsSettings::setShowSac(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -413,7 +413,7 @@ void TechnicalDetailsSettings::setGfLowAtMaxDepth(bool value) emit gfLowAtMaxDepthChanged(value); } -void TechnicalDetailsSettings::setDisplayUnusedTanks(short value) +void TechnicalDetailsSettings::setDisplayUnusedTanks(bool value) { QSettings s; s.beginGroup(tecDetails); @@ -422,7 +422,7 @@ void TechnicalDetailsSettings::setDisplayUnusedTanks(short value) emit displayUnusedTanksChanged(value); } -void TechnicalDetailsSettings::setShowAverageDepth(short value) +void TechnicalDetailsSettings::setShowAverageDepth(bool value) { QSettings s; s.beginGroup(tecDetails); diff --git a/subsurface-core/subsurface-qt/SettingsObjectWrapper.h b/subsurface-core/subsurface-qt/SettingsObjectWrapper.h index 924ca95d6..f115e2d86 100644 --- a/subsurface-core/subsurface-qt/SettingsObjectWrapper.h +++ b/subsurface-core/subsurface-qt/SettingsObjectWrapper.h @@ -52,103 +52,103 @@ private: class TechnicalDetailsSettings : public QObject { Q_OBJECT Q_PROPERTY(double modpO2 READ modp02 WRITE setModp02 NOTIFY modpO2Changed) - Q_PROPERTY(short ead READ ead WRITE setEad NOTIFY eadChanged) - Q_PROPERTY(short mod READ mod WRITE setMod NOTIFY modChanged); - Q_PROPERTY(short dcceiling READ dcceiling WRITE setDCceiling NOTIFY dcceilingChanged) - Q_PROPERTY(short redceiling READ redceiling WRITE setRedceiling NOTIFY redceilingChanged) - Q_PROPERTY(short calcceiling READ calcceiling WRITE setCalcceiling NOTIFY calcceilingChanged) - Q_PROPERTY(short calcceiling3m READ calcceiling3m WRITE setCalcceiling3m NOTIFY calcceiling3mChanged) - Q_PROPERTY(short calcalltissues READ calcalltissues WRITE setCalcalltissues NOTIFY calcalltissuesChanged) - Q_PROPERTY(short calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged) - Q_PROPERTY(short gflow READ gflow WRITE setGflow NOTIFY gflowChanged) - Q_PROPERTY(short gfhigh READ gfhigh WRITE setGfhigh NOTIFY gfhighChanged) - Q_PROPERTY(short hrgraph READ hrgraph WRITE setHRgraph NOTIFY hrgraphChanged) - Q_PROPERTY(short tankbar READ tankBar WRITE setTankBar NOTIFY tankBarChanged) - Q_PROPERTY(short percentagegraph READ percentageGraph WRITE setPercentageGraph NOTIFY percentageGraphChanged) - Q_PROPERTY(short rulergraph READ rulerGraph WRITE setRulerGraph NOTIFY rulerGraphChanged) + Q_PROPERTY(bool ead READ ead WRITE setEad NOTIFY eadChanged) + Q_PROPERTY(bool mod READ mod WRITE setMod NOTIFY modChanged); + Q_PROPERTY(bool dcceiling READ dcceiling WRITE setDCceiling NOTIFY dcceilingChanged) + Q_PROPERTY(bool redceiling READ redceiling WRITE setRedceiling NOTIFY redceilingChanged) + Q_PROPERTY(bool calcceiling READ calcceiling WRITE setCalcceiling NOTIFY calcceilingChanged) + Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE setCalcceiling3m NOTIFY calcceiling3mChanged) + Q_PROPERTY(bool calcalltissues READ calcalltissues WRITE setCalcalltissues NOTIFY calcalltissuesChanged) + Q_PROPERTY(bool calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged) + Q_PROPERTY(bool gflow READ gflow WRITE setGflow NOTIFY gflowChanged) + Q_PROPERTY(bool gfhigh READ gfhigh WRITE setGfhigh NOTIFY gfhighChanged) + Q_PROPERTY(bool hrgraph READ hrgraph WRITE setHRgraph NOTIFY hrgraphChanged) + Q_PROPERTY(bool tankbar READ tankBar WRITE setTankBar NOTIFY tankBarChanged) + Q_PROPERTY(bool percentagegraph READ percentageGraph WRITE setPercentageGraph NOTIFY percentageGraphChanged) + Q_PROPERTY(bool rulergraph READ rulerGraph WRITE setRulerGraph NOTIFY rulerGraphChanged) Q_PROPERTY(bool show_ccr_setpoint READ showCCRSetpoint WRITE setShowCCRSetpoint NOTIFY showCCRSetpointChanged) Q_PROPERTY(bool show_ccr_sensors READ showCCRSensors WRITE setShowCCRSensors NOTIFY showCCRSensorsChanged) - Q_PROPERTY(short zoomed_plot READ zoomedPlot WRITE setZoomedPlot NOTIFY zoomedPlotChanged) - Q_PROPERTY(short show_sac READ showSac WRITE setShowSac NOTIFY showSacChanged) + Q_PROPERTY(bool zoomed_plot READ zoomedPlot WRITE setZoomedPlot NOTIFY zoomedPlotChanged) + Q_PROPERTY(bool show_sac READ showSac WRITE setShowSac NOTIFY showSacChanged) Q_PROPERTY(bool gf_low_at_maxdepth READ gfLowAtMaxDepth WRITE setGfLowAtMaxDepth NOTIFY gfLowAtMaxDepthChanged) - Q_PROPERTY(short display_unused_tanks READ displayUnusedTanks WRITE setDisplayUnusedTanks NOTIFY displayUnusedTanksChanged) - Q_PROPERTY(short show_average_depth READ showAverageDepth WRITE setShowAverageDepth NOTIFY showAverageDepthChanged) + Q_PROPERTY(bool display_unused_tanks READ displayUnusedTanks WRITE setDisplayUnusedTanks NOTIFY displayUnusedTanksChanged) + Q_PROPERTY(bool show_average_depth READ showAverageDepth WRITE setShowAverageDepth NOTIFY showAverageDepthChanged) Q_PROPERTY(bool show_pictures_in_profile READ showPicturesInProfile WRITE setShowPicturesInProfile NOTIFY showPicturesInProfileChanged) public: TechnicalDetailsSettings(QObject *parent); double modp02() const; - short ead() const; - short mod() const; - short dcceiling() const; - short redceiling() const; - short calcceiling() const; - short calcceiling3m() const; - short calcalltissues() const; - short calcndltts() const; - short gflow() const; - short gfhigh() const; - short hrgraph() const; - short tankBar() const; - short percentageGraph() const; - short rulerGraph() const; + bool ead() const; + bool mod() const; + bool dcceiling() const; + bool redceiling() const; + bool calcceiling() const; + bool calcceiling3m() const; + bool calcalltissues() const; + bool calcndltts() const; + bool gflow() const; + bool gfhigh() const; + bool hrgraph() const; + bool tankBar() const; + bool percentageGraph() const; + bool rulerGraph() const; bool showCCRSetpoint() const; bool showCCRSensors() const; - short zoomedPlot() const; - short showSac() const; + bool zoomedPlot() const; + bool showSac() const; bool gfLowAtMaxDepth() const; - short displayUnusedTanks() const; - short showAverageDepth() const; + bool displayUnusedTanks() const; + bool showAverageDepth() const; bool showPicturesInProfile() const; public slots: - void setMod(short value); + void setMod(bool value); void setModp02(double value); - void setEad(short value); - void setDCceiling(short value); - void setRedceiling(short value); - void setCalcceiling(short value); - void setCalcceiling3m(short value); - void setCalcalltissues(short value); - void setCalcndltts(short value); - void setGflow(short value); - void setGfhigh(short value); - void setHRgraph(short value); - void setTankBar(short value); - void setPercentageGraph(short value); - void setRulerGraph(short value); + void setEad(bool value); + void setDCceiling(bool value); + void setRedceiling(bool value); + void setCalcceiling(bool value); + void setCalcceiling3m(bool value); + void setCalcalltissues(bool value); + void setCalcndltts(bool value); + void setGflow(bool value); + void setGfhigh(bool value); + void setHRgraph(bool value); + void setTankBar(bool value); + void setPercentageGraph(bool value); + void setRulerGraph(bool value); void setShowCCRSetpoint(bool value); void setShowCCRSensors(bool value); - void setZoomedPlot(short value); - void setShowSac(short value); + void setZoomedPlot(bool value); + void setShowSac(bool value); void setGfLowAtMaxDepth(bool value); - void setDisplayUnusedTanks(short value); - void setShowAverageDepth(short value); + void setDisplayUnusedTanks(bool value); + void setShowAverageDepth(bool value); void setShowPicturesInProfile(bool value); signals: void modpO2Changed(double value); - void eadChanged(short value); - void modChanged(short value); - void dcceilingChanged(short value); - void redceilingChanged(short value); - void calcceilingChanged(short value); - void calcceiling3mChanged(short value); - void calcalltissuesChanged(short value); - void calcndlttsChanged(short value); - void gflowChanged(short value); - void gfhighChanged(short value); - void hrgraphChanged(short value); - void tankBarChanged(short value); - void percentageGraphChanged(short value); - void rulerGraphChanged(short value); + void eadChanged(bool value); + void modChanged(bool value); + void dcceilingChanged(bool value); + void redceilingChanged(bool value); + void calcceilingChanged(bool value); + void calcceiling3mChanged(bool value); + void calcalltissuesChanged(bool value); + void calcndlttsChanged(bool value); + void gflowChanged(bool value); + void gfhighChanged(bool value); + void hrgraphChanged(bool value); + void tankBarChanged(bool value); + void percentageGraphChanged(bool value); + void rulerGraphChanged(bool value); void showCCRSetpointChanged(bool value); void showCCRSensorsChanged(bool value); - void zoomedPlotChanged(short value); - void showSacChanged(short value); + void zoomedPlotChanged(bool value); + void showSacChanged(bool value); void gfLowAtMaxDepthChanged(bool value); - void displayUnusedTanksChanged(short value); - void showAverageDepthChanged(short value); + void displayUnusedTanksChanged(bool value); + void showAverageDepthChanged(bool value); void showPicturesInProfileChanged(bool value); }; |