aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.cpp
diff options
context:
space:
mode:
authorGravatar Gehad Elrobey <gehadelrobey@gmail.com>2014-04-16 22:03:44 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-04-16 13:09:55 -0700
commit8380f096199d4da1e89789c9bd67974e550f2bf3 (patch)
tree3bfc0618202730a976a2b6df99f3cb4fd348be74 /qt-ui/profile/diveprofileitem.cpp
parent4bd4c0110815a9c5a9c9c05fbd6bd987573b2904 (diff)
downloadsubsurface-8380f096199d4da1e89789c9bd67974e550f2bf3.tar.gz
Renaming the prefs struct members to be consistent with the QSettings.
-Renaming prefs members for consistency. -Changing references of QSettings to the prefs structure instead. -Removing unused functions in pref.h were left over from an old version. -Changing the data-type of bool members to short for consistency with other members. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 6490c9b7a..c239d39a9 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -145,11 +145,11 @@ void DiveProfileItem::modelDataChanged(const QModelIndex &topLeft, const QModelI
if (polygon().isEmpty())
return;
- show_reported_ceiling = prefs.profile_dc_ceiling;
- reported_ceiling_in_red = prefs.profile_red_ceiling;
+ show_reported_ceiling = prefs.dcceiling;
+ reported_ceiling_in_red = prefs.redceiling;
/* Show any ceiling we may have encountered */
- if (prefs.profile_dc_ceiling && !prefs.profile_red_ceiling) {
+ if (prefs.dcceiling && !prefs.redceiling) {
QPolygonF p = polygon();
plot_data *entry = dataModel->data().entry + dataModel->rowCount() - 1;
for (int i = dataModel->rowCount() - 1; i >= 0; i--, entry--) {
@@ -197,7 +197,7 @@ void DiveProfileItem::modelDataChanged(const QModelIndex &topLeft, const QModelI
void DiveProfileItem::preferencesChanged()
{
//TODO: Only modelDataChanged() here if we need to rebuild the graph ( for instance,
- // if the prefs.profile_dc_ceiling are enabled, but prefs.profile_red_ceiling is disabled
+ // if the prefs.dcceiling are enabled, but prefs.redceiling is disabled
// and only if it changed something. let's not waste cpu cycles repoloting something we don't need to.
modelDataChanged();
}
@@ -552,9 +552,7 @@ DiveCalculatedTissue::DiveCalculatedTissue()
void DiveCalculatedTissue::preferencesChanged()
{
- QSettings s;
- s.beginGroup("TecDetails");
- setVisible(s.value("calcalltissues").toBool() && s.value("calcceiling").toBool());
+ setVisible(prefs.calcalltissues && prefs.calcceiling);
}
void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
@@ -579,7 +577,7 @@ void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QMo
setPolygon(p);
QLinearGradient pat(0, p.boundingRect().top(), 0, p.boundingRect().bottom());
// does the user want the ceiling in "surface color" or in red?
- if (prefs.profile_red_ceiling) {
+ if (prefs.redceiling) {
pat.setColorAt(0, getColor(CEILING_SHALLOW));
pat.setColorAt(1, getColor(CEILING_DEEP));
} else {
@@ -592,23 +590,17 @@ void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QMo
void DiveCalculatedCeiling::preferencesChanged()
{
- QSettings s;
- s.beginGroup("TecDetails");
-
- bool shouldShow3mIncrement = s.value("calcceiling3m").toBool();
- if (dataModel && is3mIncrement != shouldShow3mIncrement) {
+ if (dataModel && is3mIncrement != prefs.calcceiling3m) {
// recalculate that part.
dataModel->calculateDecompression();
}
- is3mIncrement = shouldShow3mIncrement;
- setVisible(s.value("calcceiling").toBool());
+ is3mIncrement = prefs.calcceiling3m;
+ setVisible(prefs.calcceiling);
}
void DiveReportedCeiling::preferencesChanged()
{
- QSettings s;
- s.beginGroup("TecDetails");
- setVisible(s.value("dcceiling").toBool());
+ setVisible(prefs.dcceiling);
}
void DiveReportedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)