diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/windowtitleupdate.cpp | 28 | ||||
-rw-r--r-- | core/windowtitleupdate.h | 9 |
2 files changed, 4 insertions, 33 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(); } diff --git a/core/windowtitleupdate.h b/core/windowtitleupdate.h index dcda821e9..f08467789 100644 --- a/core/windowtitleupdate.h +++ b/core/windowtitleupdate.h @@ -7,15 +7,10 @@ class WindowTitleUpdate : public QObject { Q_OBJECT -public: - explicit WindowTitleUpdate(QObject *parent = 0); - ~WindowTitleUpdate(); - static WindowTitleUpdate *instance(); - void emitSignal(); signals: void updateTitle(); -private: - static WindowTitleUpdate *m_instance; }; +extern WindowTitleUpdate windowTitleUpdate; + #endif // WINDOWTITLEUPDATE_H |