summaryrefslogtreecommitdiffstats
path: root/core/windowtitleupdate.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-07-30 20:59:07 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-30 13:55:23 -0700
commit7fe76a5dbdef4a833122e0311191dd51896575f4 (patch)
tree34b1d4f8a7c2d6d4b6b97a142ca27937c4ec4284 /core/windowtitleupdate.cpp
parent4bdd811f06096c2420a05dd3cc78fffbd7f3a663 (diff)
downloadsubsurface-7fe76a5dbdef4a833122e0311191dd51896575f4.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/windowtitleupdate.cpp')
-rw-r--r--core/windowtitleupdate.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/core/windowtitleupdate.cpp b/core/windowtitleupdate.cpp
index 810acd4dc..a0cc277b3 100644
--- a/core/windowtitleupdate.cpp
+++ b/core/windowtitleupdate.cpp
@@ -1,33 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
#include "windowtitleupdate.h"
-WindowTitleUpdate *WindowTitleUpdate::m_instance = NULL;
-
-WindowTitleUpdate::WindowTitleUpdate(QObject *parent) : QObject(parent)
-{
- Q_ASSERT_X(m_instance == NULL, "WindowTitleUpdate", "WindowTitleUpdate recreated!");
-
- m_instance = this;
-}
-
-WindowTitleUpdate *WindowTitleUpdate::instance()
-{
- return m_instance;
-}
-
-WindowTitleUpdate::~WindowTitleUpdate()
-{
- m_instance = NULL;
-}
-
-void WindowTitleUpdate::emitSignal()
-{
- emit updateTitle();
-}
+WindowTitleUpdate windowTitleUpdate;
extern "C" void updateWindowTitle()
{
- WindowTitleUpdate *wt = WindowTitleUpdate::instance();
- if (wt)
- wt->emitSignal();
+ emit windowTitleUpdate.updateTitle();
}