summaryrefslogtreecommitdiffstats
path: root/profile-widget/diveprofileitem.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-11-24 12:50:52 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-12 15:52:40 -0800
commit2d7be7a0e366b562fdff914e92219ab1852cd3c8 (patch)
tree7f4501cfe26b31f3a98f3b66cfaf925107a588d9 /profile-widget/diveprofileitem.cpp
parent8bbd778c28f52277dbee4a8d7bcb577c61a611f6 (diff)
downloadsubsurface-2d7be7a0e366b562fdff914e92219ab1852cd3c8.tar.gz
preferences: create global settingsChanged signal
So far, the PreferencesDialog emitted a settingsChanged signal. This meant that models that listened to that signal had to conditionally compile out the code for mobile or the connection had to be made in MainWindow. Instead, introduce a global signal that does this and move the connects to the listeners to remove inter-dependencies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/diveprofileitem.cpp')
-rw-r--r--profile-widget/diveprofileitem.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp
index a63b35863..c6df6ee50 100644
--- a/profile-widget/diveprofileitem.cpp
+++ b/profile-widget/diveprofileitem.cpp
@@ -5,22 +5,18 @@
#include "profile-widget/divetextitem.h"
#include "profile-widget/animationfunctions.h"
#include "core/profile.h"
-#ifndef SUBSURFACE_MOBILE
-#include "desktop-widgets/preferences/preferencesdialog.h"
-#endif
#include "qt-models/diveplannermodel.h"
#include "core/qthelper.h"
#include "core/settings/qPrefTechnicalDetails.h"
#include "core/settings/qPrefLog.h"
+#include "core/subsurface-qt/divelistnotifier.h"
#include "libdivecomputer/parser.h"
#include "profile-widget/profilewidget2.h"
AbstractProfilePolygonItem::AbstractProfilePolygonItem() : QObject(), QGraphicsPolygonItem(), hAxis(NULL), vAxis(NULL), dataModel(NULL), hDataColumn(-1), vDataColumn(-1)
{
setCacheMode(DeviceCoordinateCache);
-#ifndef SUBSURFACE_MOBILE
- connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
-#endif
+ connect(&diveListNotifier, &DiveListNotifier::settingsChanged, this, &AbstractProfilePolygonItem::settingsChanged);
}
void AbstractProfilePolygonItem::settingsChanged()