mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
2a48170fd3
commit
1988da779f
1 changed files with 2 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue