| 
									
										
										
										
											2017-04-27 20:24:53 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2015-06-16 06:04:34 -07:00
										 |  |  | #include "windowtitleupdate.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WindowTitleUpdate *WindowTitleUpdate::m_instance = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WindowTitleUpdate::WindowTitleUpdate(QObject *parent) : QObject(parent) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-06-17 18:11:32 +10:00
										 |  |  | 	Q_ASSERT_X(m_instance == NULL, "WindowTitleUpdate", "WindowTitleUpdate recreated!"); | 
					
						
							| 
									
										
										
										
											2015-06-16 06:04:34 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	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(); | 
					
						
							| 
									
										
										
										
											2015-11-07 09:53:17 -08:00
										 |  |  | 	if (wt) | 
					
						
							|  |  |  | 		wt->emitSignal(); | 
					
						
							| 
									
										
										
										
											2015-06-16 06:04:34 -07:00
										 |  |  | } |