summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-08 15:00:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-11 16:25:32 -0700
commit8091497745c385666e38a7911881189dbd0d73e0 (patch)
tree51f9bb916002da67075803d3b39a7d2a64ca4c45 /desktop-widgets
parent754160d625d374cc2b98df53511371b0ab286c7a (diff)
downloadsubsurface-8091497745c385666e38a7911881189dbd0d73e0.tar.gz
Map: split void MapWidget::setEditMode()
The setEditMode(bool) function behaves very differently, when entering and exiting edit mode. Therefore, split it in two versions. This will allow to pass arguments that make sense only when entering the edit mode. Since setEditMode() doesn't exist anymore, turn the editMode Q_PROPERTY line to the MEMBER version. Accordingly, remove the reader function. If QML wants to enter edit mode, it should invoke the appropriate function and not simply set the flag. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mapwidget.cpp12
-rw-r--r--desktop-widgets/mapwidget.h1
2 files changed, 3 insertions, 10 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index 4b626fcc8..ca519b774 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -82,27 +82,21 @@ void MapWidget::repopulateLabels()
void MapWidget::reload()
{
CHECK_IS_READY_RETURN_VOID();
- setEditMode(false);
+ m_mapHelper->exitEditMode();
if (!skipReload)
m_mapHelper->reloadMapLocations();
}
-void MapWidget::setEditMode(bool editMode)
-{
- CHECK_IS_READY_RETURN_VOID();
- m_mapHelper->setEditMode(editMode);
-}
-
void MapWidget::endGetDiveCoordinates()
{
CHECK_IS_READY_RETURN_VOID();
- setEditMode(false);
+ m_mapHelper->exitEditMode();
}
void MapWidget::prepareForGetDiveCoordinates()
{
CHECK_IS_READY_RETURN_VOID();
- setEditMode(true);
+ m_mapHelper->enterEditMode();
}
void MapWidget::selectedDivesChanged(QList<int> list)
diff --git a/desktop-widgets/mapwidget.h b/desktop-widgets/mapwidget.h
index e85dd885b..7ce8e7df8 100644
--- a/desktop-widgets/mapwidget.h
+++ b/desktop-widgets/mapwidget.h
@@ -40,7 +40,6 @@ public slots:
void updateDiveSiteCoordinates(uint32_t uuid, degrees_t latitude, degrees_t longitude);
private:
- void setEditMode(bool editMode);
static MapWidget *m_instance;
QQuickItem *m_rootItem;
MapWidgetHelper *m_mapHelper;