From 00a7baae0338035eea22400a41e0eabc347b4361 Mon Sep 17 00:00:00 2001 From: John Tapsell Date: Sun, 20 Oct 2013 01:27:26 +0100 Subject: [PATCH] Remove MainWindow styleChanged() signal There's no need to create multiple signals - connect() is fine with connecting styleChanged(MainWindow::QGC_MAINWINDOW_STYLE) to a slot with no parameters. --- src/ui/MainWindow.cc | 1 - src/ui/MainWindow.h | 1 - src/ui/linechart/LinechartWidget.cc | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index f3b8678c8..3eb6b8d8b 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -1145,7 +1145,6 @@ bool MainWindow::loadStyle(QGC_MAINWINDOW_STYLE style, QString cssFile) // And trigger any changes to other UI elements that are watching for // theme changes. emit styleChanged(style); - emit styleChanged(); // Finally restore the cursor before returning. qApp->restoreOverrideCursor(); diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index 9390d6fd2..9d5cd528f 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -300,7 +300,6 @@ protected slots: signals: void styleChanged(MainWindow::QGC_MAINWINDOW_STYLE newTheme); - void styleChanged(); void initStatusChanged(const QString& message, int alignment, const QColor &color); #ifdef MOUSE_ENABLED_LINUX /** @brief Forward X11Event to catch 3DMouse inputs */ diff --git a/src/ui/linechart/LinechartWidget.cc b/src/ui/linechart/LinechartWidget.cc index 39f68c8f2..b6356be1c 100644 --- a/src/ui/linechart/LinechartWidget.cc +++ b/src/ui/linechart/LinechartWidget.cc @@ -138,7 +138,7 @@ LinechartWidget::LinechartWidget(int systemid, QWidget *parent) : QWidget(parent createLayout(); // And make sure we're listening for future style changes - connect(MainWindow::instance(), SIGNAL(styleChanged()), this, SLOT(recolor())); + connect(MainWindow::instance(), SIGNAL(styleChanged(MainWindow::QGC_MAINWINDOW_STYLE)), this, SLOT(recolor())); updateTimer->setInterval(updateInterval); connect(updateTimer, SIGNAL(timeout()), this, SLOT(refresh())); -- 2.22.0