summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--profile-widget/profilewidget2.cpp3
-rw-r--r--profile-widget/profilewidget2.h1
-rw-r--r--subsurface-desktop-main.cpp1
3 files changed, 3 insertions, 2 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index c72f2e95b..275ae6cde 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -30,7 +30,6 @@
#ifndef QT_NO_DEBUG
#include <QTableView>
#endif
-#include "mainwindow.h"
#include "preferences/preferencesdialog.h"
// a couple of helpers we need
@@ -1272,7 +1271,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
action->setData(event->globalPos());
if (same_string(current_dc->model, "manually added dive"))
- QAction *editProfileAction = m.addAction(tr("Edit the profile"), MainWindow::instance(), SLOT(editCurrentDive()));
+ QAction *editProfileAction = m.addAction(tr("Edit the profile"), this, SIGNAL(editCurrentDive()));
if (DiveEventItem *item = dynamic_cast<DiveEventItem *>(sceneItem)) {
action = new QAction(&m);
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index f5977eb22..dcfc72c17 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -94,6 +94,7 @@ signals:
void disableShortcuts(bool paste);
void refreshDisplay(bool recreateDivelist);
void updateDiveInfo(bool clear);
+ void editCurrentDive();
public
slots: // Necessary to call from QAction's signals.
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index d5caf64d3..5e07a25e5 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -93,6 +93,7 @@ int main(int argc, char **argv)
QObject::connect(m->graphics(), &ProfileWidget2::enableShortcuts, m, &MainWindow::enableShortcuts, Qt::AutoConnection);
QObject::connect(m->graphics(), &ProfileWidget2::refreshDisplay, m, &MainWindow::refreshDisplay, Qt::AutoConnection);
QObject::connect(m->graphics(), &ProfileWidget2::updateDiveInfo, m->information(), &MainTab::updateDiveInfo, Qt::AutoConnection);
+ QObject::connect(m->graphics(), &ProfileWidget2::editCurrentDive, m, &MainWindow::editCurrentDive, Qt::AutoConnection);
if (verbose > 0)
print_files();
if (!quit)