diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/locationinformation.cpp | 1 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/mapwidget.cpp | 11 | ||||
-rw-r--r-- | desktop-widgets/mapwidget.h | 1 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 4 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.h | 2 |
6 files changed, 14 insertions, 7 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index 1216bde89..73d4aeab1 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -360,7 +360,6 @@ bool DiveLocationFilterProxyModel::lessThan(const QModelIndex &source_left, cons return source_left.data().toString() < source_right.data().toString(); } - DiveLocationModel::DiveLocationModel(QObject*) { resetModel(); diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index a7e91732b..fdd73d943 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -229,7 +229,7 @@ MainWindow::MainWindow() : QMainWindow(), connect(DivePlannerPointsModel::instance(), SIGNAL(variationsComputed(QString)), this, SLOT(updateVariations(QString))); connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget(), SLOT(printDecoPlan())); connect(this, SIGNAL(startDiveSiteEdit()), this, SLOT(on_actionDiveSiteEdit_triggered())); - connect(information(), SIGNAL(diveSiteChanged(struct dive_site *)), mapWidget, SLOT(centerOnDiveSite(struct dive_site *))); + connect(information(), &MainTab::diveSiteChanged, mapWidget, &MapWidget::centerOnSelectedDiveSite); connect(this, &MainWindow::showError, ui.mainErrorMessage, &NotificationWidget::showError, Qt::AutoConnection); connect(&windowTitleUpdate, &WindowTitleUpdate::updateTitle, this, &MainWindow::setAutomaticTitle); diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index 917b1b2c7..a940cdb39 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -50,6 +50,13 @@ void MapWidget::doneLoading(QQuickWidget::Status status) this, SLOT(coordinatesChangedLocal())); } +void MapWidget::centerOnSelectedDiveSite() +{ + CHECK_IS_READY_RETURN_VOID(); + if (!skipReload) + m_mapHelper->centerOnSelectedDiveSite(); +} + void MapWidget::centerOnDiveSite(struct dive_site *ds) { CHECK_IS_READY_RETURN_VOID(); @@ -60,9 +67,9 @@ void MapWidget::centerOnDiveSite(struct dive_site *ds) void MapWidget::centerOnIndex(const QModelIndex& idx) { CHECK_IS_READY_RETURN_VOID(); - struct dive_site *ds = get_dive_site_by_uuid(idx.model()->index(idx.row(), 0).data().toInt()); + struct dive_site *ds = get_dive_site_by_uuid(idx.model()->index(idx.row(), 0).data().toUInt()); if (!ds || !dive_site_has_gps_location(ds)) - centerOnDiveSite(&displayed_dive_site); + centerOnSelectedDiveSite(); else centerOnDiveSite(ds); } diff --git a/desktop-widgets/mapwidget.h b/desktop-widgets/mapwidget.h index 801913594..02b68483d 100644 --- a/desktop-widgets/mapwidget.h +++ b/desktop-widgets/mapwidget.h @@ -27,6 +27,7 @@ signals: void coordinatesChanged(); public slots: + void centerOnSelectedDiveSite(); void centerOnDiveSite(struct dive_site *); void centerOnIndex(const QModelIndex& idx); void endGetDiveCoordinates(); diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 070184a86..b6ac56ed7 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -643,7 +643,7 @@ void MainTab::updateDiveInfo(bool clear) if (verbose) qDebug() << "Set the current dive site:" << displayed_dive.dive_site_uuid; - emit diveSiteChanged(get_dive_site_by_uuid(displayed_dive.dive_site_uuid)); + emit diveSiteChanged(); } void MainTab::addCylinder_clicked() @@ -1384,7 +1384,7 @@ void MainTab::on_location_diveSiteSelected() if (ui.location->text().isEmpty()) { displayed_dive.dive_site_uuid = 0; markChangedWidget(ui.location); - emit diveSiteChanged(0); + emit diveSiteChanged(); return; } else { if (ui.location->currDiveSiteUuid() != displayed_dive.dive_site_uuid) { diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index 31e3d14b0..238c060f8 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -59,7 +59,7 @@ public: signals: void addDiveFinished(); void dateTimeChanged(); - void diveSiteChanged(struct dive_site * ds); + void diveSiteChanged(); public slots: void addCylinder_clicked(); |