summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-24 21:47:19 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commit64697375cf4dc2bda7db3f4846a500d4e30f6fc4 (patch)
treec1d942e3be260694f0343aecef35abe7926f58dc /desktop-widgets/mapwidget.cpp
parentc078e350e0ca11ad09a9fb57fcf94b95671e6ae4 (diff)
downloadsubsurface-64697375cf4dc2bda7db3f4846a500d4e30f6fc4.tar.gz
mapwidget: connect the helper selectedDivesChanged() signal
The selectedDivesChanged() signal from MapWidgetHelper is connected to a local slot. One problem here is that this crashes with the calls to DiveListView(). The dive list widget triggers events that call reload() on the MapWidget (same happens for Marble's Globe class) and that crashes somewhere in the QML shared library. TODO: investigate. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'desktop-widgets/mapwidget.cpp')
-rw-r--r--desktop-widgets/mapwidget.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index c378b9fb3..d5a926f59 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -9,6 +9,8 @@
#include "core/divesite.h"
#include "mobile-widgets/qmlmapwidgethelper.h"
#include "qt-models/maplocationmodel.h"
+#include "mainwindow.h"
+#include "divelistview.h"
MapWidget *MapWidget::m_instance = NULL;
@@ -23,6 +25,8 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
m_rootItem = qobject_cast<QQuickItem *>(rootObject());
m_mapHelper = rootObject()->findChild<MapWidgetHelper *>();
+ connect(m_mapHelper, SIGNAL(selectedDivesChanged(QList<int>)),
+ this, SLOT(selectedDivesChanged(QList<int>)));
}
void MapWidget::centerOnDiveSite(struct dive_site *ds)
@@ -59,6 +63,16 @@ void MapWidget::prepareForGetDiveCoordinates()
// TODO;
}
+void MapWidget::selectedDivesChanged(QList<int> list)
+{
+ qDebug() << "onSelectedDivesChanged:" << list.size();
+ /*
+ MainWindow::instance()->dive_list()->unselectDives();
+ if (!list.empty())
+ MainWindow::instance()->dive_list()->selectDives(list);
+ */
+}
+
MapWidget::~MapWidget()
{
m_instance = NULL;