From 7fe76a5dbdef4a833122e0311191dd51896575f4 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 30 Jul 2018 20:59:07 +0200 Subject: Cleanup: Make WindowsTitleUpdate a global object WindowsTitleUpdate is such a trivial object (a QObject with a single signal and no own state), that it's not really understandable why it would need all that "singleton" boiler-plate. Just make it a default constructed/destructed global object. Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 3 +-- desktop-widgets/mainwindow.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 64ea2ef6d..9da89f8f5 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -218,8 +218,7 @@ MainWindow::MainWindow() : QMainWindow(), connect(information(), SIGNAL(diveSiteChanged(struct dive_site *)), mapWidget, SLOT(centerOnDiveSite(struct dive_site *))); connect(this, &MainWindow::showError, ui.mainErrorMessage, &NotificationWidget::showError, Qt::AutoConnection); - wtu = new WindowTitleUpdate(); - connect(WindowTitleUpdate::instance(), SIGNAL(updateTitle()), this, SLOT(setAutomaticTitle())); + connect(&windowTitleUpdate, &WindowTitleUpdate::updateTitle, this, &MainWindow::setAutomaticTitle); #ifdef NO_PRINTING plannerDetails->printPlan()->hide(); ui.menuFile->removeAction(ui.actionPrint); diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 8c7347fd3..da3396981 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -17,7 +17,6 @@ #include "ui_mainwindow.h" #include "ui_plannerDetails.h" #include "desktop-widgets/notificationwidget.h" -#include "core/windowtitleupdate.h" #include "core/gpslocation.h" #define NUM_RECENT_FILES 4 @@ -253,7 +252,6 @@ private: QHash applicationState; QHash stateProperties; - WindowTitleUpdate *wtu; GpsLocation *locationProvider; QMenu *connections; QAction *share_on_fb; -- cgit v1.2.3-70-g09d2