diff options
-rw-r--r-- | desktop-widgets/divelistview.cpp | 4 | ||||
-rw-r--r-- | desktop-widgets/divelistview.h | 2 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 7 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.h | 2 | ||||
-rw-r--r-- | desktop-widgets/starwidget.cpp | 4 |
5 files changed, 8 insertions, 11 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 8795eeea8..8e6885ee1 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -342,7 +342,7 @@ void DiveListView::selectDives(const QList<int> &newDiveSelection) scrollTo(idx); } // now that everything is up to date, update the widgets - Q_EMIT currentDiveChanged(selected_dive); + emit currentDiveChanged(); dontEmitDiveChangedSignal = false; return; } @@ -544,7 +544,7 @@ void DiveListView::selectionChanged(const QItemSelection &selected, const QItemS connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(selectionChanged(QItemSelection, QItemSelection))); connect(selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex, QModelIndex))); if (!dontEmitDiveChangedSignal) - Q_EMIT currentDiveChanged(selected_dive); + emit currentDiveChanged(); } enum asked_user {NOTYET, MERGE, DONTMERGE}; diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h index 1fe0e803d..e70f96a72 100644 --- a/desktop-widgets/divelistview.h +++ b/desktop-widgets/divelistview.h @@ -59,7 +59,7 @@ slots: void loadWebImages(); signals: - void currentDiveChanged(int divenr); + void currentDiveChanged(); private: bool mouseClickSelection; diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index a9423e053..64ea2ef6d 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -193,7 +193,7 @@ MainWindow::MainWindow() : QMainWindow(), if (!QIcon::hasThemeIcon("window-close")) { QIcon::setThemeName("subsurface"); } - connect(dive_list(), SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int))); + connect(dive_list(), &DiveListView::currentDiveChanged, this, &MainWindow::current_dive_changed); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveListView, SLOT(update())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveListView, SLOT(reloadHeaderActions())); @@ -535,11 +535,8 @@ void MainWindow::configureToolbar() { } } -void MainWindow::current_dive_changed(int divenr) +void MainWindow::current_dive_changed() { - if (divenr >= 0) { - select_dive(divenr); - } graphics()->plotDive(nullptr, false, true); information()->updateDiveInfo(); configureToolbar(); diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index ab9ebf316..8c7347fd3 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -138,7 +138,7 @@ slots: void on_action_Check_for_Updates_triggered(); void on_actionDiveSiteEdit_triggered(); - void current_dive_changed(int divenr); + void current_dive_changed(); void initialUiSetup(); void on_actionImportDiveLog_triggered(); diff --git a/desktop-widgets/starwidget.cpp b/desktop-widgets/starwidget.cpp index f5ba43be8..2f72d7df0 100644 --- a/desktop-widgets/starwidget.cpp +++ b/desktop-widgets/starwidget.cpp @@ -57,7 +57,7 @@ void StarWidget::mouseReleaseEvent(QMouseEvent *event) else current = starClicked; - Q_EMIT valueChanged(current); + emit valueChanged(current); update(); } @@ -88,7 +88,7 @@ void StarWidget::setCurrentStars(int value) { current = value; update(); - Q_EMIT valueChanged(current); + emit valueChanged(current); } StarWidget::StarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f), |