summaryrefslogtreecommitdiffstats
path: root/subsurface-core/windowtitleupdate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'subsurface-core/windowtitleupdate.cpp')
-rw-r--r--subsurface-core/windowtitleupdate.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/subsurface-core/windowtitleupdate.cpp b/subsurface-core/windowtitleupdate.cpp
new file mode 100644
index 000000000..eec324c68
--- /dev/null
+++ b/subsurface-core/windowtitleupdate.cpp
@@ -0,0 +1,31 @@
+#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();
+}
+
+extern "C" void updateWindowTitle()
+{
+ WindowTitleUpdate *wt = WindowTitleUpdate::instance();
+ wt->emitSignal();
+}