summaryrefslogtreecommitdiffstats
path: root/subsurface-core/windowtitleupdate.cpp
blob: 963455f1d7f2084b4450d08092a7ee218327c30e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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();
	if (wt)
		wt->emitSignal();
}