diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-05-21 12:57:48 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-22 07:31:05 +0900 |
commit | 1988da779f479e90b2d3f971ba6099f04475cc70 (patch) | |
tree | b56bf35d7c0e4207bd7c2361d047ccd185a655cf /qt-ui/profile/profilewidget2.cpp | |
parent | 2a48170fd3103771bae855bde71198febc0ad789 (diff) | |
download | subsurface-1988da779f479e90b2d3f971ba6099f04475cc70.tar.gz |
Remove use of QSettings for ruler visibility, use prefs.rulergraph instead.
The QSettings is a bit bloated on its use, so we are trying to narrow
down the amount of calls to it. We have a preferences struct, use that
instead.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 306ee2cb9..d222ad940 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -21,7 +21,6 @@ #include <QMenu> #include <QContextMenuEvent> #include <QDebug> -#include <QSettings> #include <QScrollBar> #include <QtCore/qmath.h> #include <QMessageBox> @@ -360,10 +359,7 @@ void ProfileWidget2::plotDives(QList<dive *> dives) // reset some item visibility on printMode changes toolTipItem->setVisible(!printMode); - QSettings s; - s.beginGroup("TecDetails"); - const bool rulerVisible = s.value("rulergraph", false).toBool() && !printMode; - rulerItem->setVisible(rulerVisible); + rulerItem->setVisible(prefs.rulergraph && !printMode); // No need to do this again if we are already showing the same dive // computer of the same dive, so we check the unique id of the dive @@ -679,10 +675,7 @@ void ProfileWidget2::setProfileState() tissue->setVisible(true); } } - QSettings s; - s.beginGroup("TecDetails"); - bool rulerVisible = s.value("rulergraph", false).toBool(); - rulerItem->setVisible(rulerVisible); + rulerItem->setVisible(prefs.rulergraph); } extern struct ev_select *ev_namelist; |