From 1988da779f479e90b2d3f971ba6099f04475cc70 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 21 May 2014 12:57:48 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'qt-ui/profile/profilewidget2.cpp') 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 #include #include -#include #include #include #include @@ -360,10 +359,7 @@ void ProfileWidget2::plotDives(QList 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; -- cgit v1.2.3-70-g09d2