core: SettingsObjectWrapper remove buehlmann property

remove buehlmann(), setBuehlmann(bool)

buehlmann() is really planner_deco_mode == BUEHLMANN, so no need for a function
setBuehlmann is dangerous, because buehlmann is saved on disk, but not in prefs.* and thus can lead to inconsistency between bool buehlmann and planner_deco_moce.

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-08-04 19:29:07 +02:00 committed by Dirk Hohndel
parent 26be37fe58
commit 3c69c8299b
3 changed files with 0 additions and 24 deletions

View file

@ -198,11 +198,6 @@ bool TechnicalDetailsSettings::calcndltts() const
return prefs.calcndltts; return prefs.calcndltts;
} }
bool TechnicalDetailsSettings::buehlmann() const
{
return prefs.planner_deco_mode == BUEHLMANN;
}
int TechnicalDetailsSettings::gflow() const int TechnicalDetailsSettings::gflow() const
{ {
return prefs.gflow; return prefs.gflow;
@ -408,17 +403,6 @@ void TechnicalDetailsSettings::setCalcndltts(bool value)
emit calcndlttsChanged(value); emit calcndlttsChanged(value);
} }
void TechnicalDetailsSettings::setBuehlmann(bool value)
{
if (value == (prefs.planner_deco_mode == BUEHLMANN))
return;
QSettings s;
s.beginGroup(group);
s.setValue("buehlmann", value);
prefs.planner_deco_mode = value ? BUEHLMANN : VPMB;
emit buehlmannChanged(value);
}
void TechnicalDetailsSettings::setGflow(int value) void TechnicalDetailsSettings::setGflow(int value)
{ {
if (value == prefs.gflow) if (value == prefs.gflow)

View file

@ -67,7 +67,6 @@ class TechnicalDetailsSettings : public QObject {
Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE setCalcceiling3m NOTIFY calcceiling3mChanged) Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE setCalcceiling3m NOTIFY calcceiling3mChanged)
Q_PROPERTY(bool calcalltissues READ calcalltissues WRITE setCalcalltissues NOTIFY calcalltissuesChanged) Q_PROPERTY(bool calcalltissues READ calcalltissues WRITE setCalcalltissues NOTIFY calcalltissuesChanged)
Q_PROPERTY(bool calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged) Q_PROPERTY(bool calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged)
Q_PROPERTY(bool buehlmann READ buehlmann WRITE setBuehlmann NOTIFY buehlmannChanged)
Q_PROPERTY(int gflow READ gflow WRITE setGflow NOTIFY gflowChanged) Q_PROPERTY(int gflow READ gflow WRITE setGflow NOTIFY gflowChanged)
Q_PROPERTY(int gfhigh READ gfhigh WRITE setGfhigh NOTIFY gfhighChanged) Q_PROPERTY(int gfhigh READ gfhigh WRITE setGfhigh NOTIFY gfhighChanged)
Q_PROPERTY(short vpmb_conservatism READ vpmbConservatism WRITE setVpmbConservatism NOTIFY vpmbConservatismChanged) Q_PROPERTY(short vpmb_conservatism READ vpmbConservatism WRITE setVpmbConservatism NOTIFY vpmbConservatismChanged)
@ -98,7 +97,6 @@ public:
bool calcceiling3m() const; bool calcceiling3m() const;
bool calcalltissues() const; bool calcalltissues() const;
bool calcndltts() const; bool calcndltts() const;
bool buehlmann() const;
int gflow() const; int gflow() const;
int gfhigh() const; int gfhigh() const;
short vpmbConservatism() const; short vpmbConservatism() const;
@ -127,7 +125,6 @@ public slots:
void setCalcceiling3m(bool value); void setCalcceiling3m(bool value);
void setCalcalltissues(bool value); void setCalcalltissues(bool value);
void setCalcndltts(bool value); void setCalcndltts(bool value);
void setBuehlmann(bool value);
void setGflow(int value); void setGflow(int value);
void setGfhigh(int value); void setGfhigh(int value);
void setVpmbConservatism(short); void setVpmbConservatism(short);
@ -156,7 +153,6 @@ signals:
void calcceiling3mChanged(bool value); void calcceiling3mChanged(bool value);
void calcalltissuesChanged(bool value); void calcalltissuesChanged(bool value);
void calcndlttsChanged(bool value); void calcndlttsChanged(bool value);
void buehlmannChanged(bool value);
void gflowChanged(int value); void gflowChanged(int value);
void gfhighChanged(int value); void gfhighChanged(int value);
void vpmbConservatismChanged(short value); void vpmbConservatismChanged(short value);

View file

@ -61,8 +61,6 @@ void TestPreferences::testPreferences()
TEST(tecDetails->calcalltissues(), true); TEST(tecDetails->calcalltissues(), true);
tecDetails->setCalcndltts(true); tecDetails->setCalcndltts(true);
TEST(tecDetails->calcndltts(), true); TEST(tecDetails->calcndltts(), true);
tecDetails->setBuehlmann(true);
TEST(tecDetails->buehlmann(), true);
tecDetails->setHRgraph(true); tecDetails->setHRgraph(true);
TEST(tecDetails->hrgraph(), true); TEST(tecDetails->hrgraph(), true);
tecDetails->setTankBar(true); tecDetails->setTankBar(true);
@ -102,8 +100,6 @@ void TestPreferences::testPreferences()
TEST(tecDetails->calcalltissues(), false); TEST(tecDetails->calcalltissues(), false);
tecDetails->setCalcndltts(false); tecDetails->setCalcndltts(false);
TEST(tecDetails->calcndltts(), false); TEST(tecDetails->calcndltts(), false);
tecDetails->setBuehlmann(false);
TEST(tecDetails->buehlmann(), false);
tecDetails->setHRgraph(false); tecDetails->setHRgraph(false);
TEST(tecDetails->hrgraph(), false); TEST(tecDetails->hrgraph(), false);
tecDetails->setTankBar(false); tecDetails->setTankBar(false);