Changeset 51047 in vbox
- Timestamp:
- Apr 11, 2014 11:21:25 AM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extradata
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r51038 r51047 49 49 /** Notifies about HID LED sync state change. */ 50 50 void sigHIDLedsSyncStateChange(bool fEnabled); 51 51 52 #ifdef RT_OS_DARWIN 52 53 /** Mac OS X: Notifies about 'presentation mode' status change. */ … … 172 173 UIExtraDataManager* UIExtraDataManager::instance() 173 174 { 174 /* Create instance if not yet exists: */175 /* Create/prepare instance if not yet exists: */ 175 176 if (!m_pInstance) 176 m_pInstance = new UIExtraDataManager(); 177 { 178 new UIExtraDataManager; 179 m_pInstance->prepare(); 180 } 177 181 /* Return instance: */ 178 182 return m_pInstance; … … 182 186 void UIExtraDataManager::destroy() 183 187 { 184 /* Destroy instance if still exists: */188 /* Destroy/cleanup instance if still exists: */ 185 189 if (m_pInstance) 186 190 { 191 m_pInstance->cleanup(); 187 192 delete m_pInstance; 188 m_pInstance = 0;189 193 } 190 194 } … … 192 196 UIExtraDataManager::UIExtraDataManager() 193 197 : m_pHandler(new UIExtraDataEventHandler(this)) 198 { 199 /* Connect to static instance: */ 200 m_pInstance = this; 201 } 202 203 UIExtraDataManager::~UIExtraDataManager() 204 { 205 /* Disconnect from static instance: */ 206 m_pInstance = 0; 207 } 208 209 void UIExtraDataManager::prepare() 210 { 211 /* Prepare Main event-listener: */ 212 prepareMainEventListener(); 213 /* Prepare extra-data event-handler: */ 214 prepareExtraDataEventHandler(); 215 } 216 217 void UIExtraDataManager::prepareMainEventListener() 194 218 { 195 219 /* Register Main event-listener: */ … … 214 238 m_pHandler, SLOT(sltExtraDataChange(QString, QString, QString)), 215 239 Qt::DirectConnection); 216 240 } 241 242 void UIExtraDataManager::prepareExtraDataEventHandler() 243 { 217 244 /* Language change signal: */ 218 245 connect(m_pHandler, SIGNAL(sigLanguageChange(QString)), … … 246 273 } 247 274 248 UIExtraDataManager::~UIExtraDataManager() 275 void UIExtraDataManager::cleanup() 276 { 277 /* Cleanup Main event-listener: */ 278 cleanupMainEventListener(); 279 } 280 281 void UIExtraDataManager::cleanupMainEventListener() 249 282 { 250 283 /* Unregister Main event-listener: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r51038 r51047 68 68 ~UIExtraDataManager(); 69 69 70 /** Prepare Extra-data Manager. */ 71 void prepare(); 72 /** Prepare Main event-listener. */ 73 void prepareMainEventListener(); 74 /** Prepare extra-data event-handler. */ 75 void prepareExtraDataEventHandler(); 76 77 /** Cleanup Extra-data Manager. */ 78 void cleanup(); 79 /** Cleanup Main event-listener. */ 80 void cleanupMainEventListener(); 81 // /** Cleanup extra-data event-handler. */ 82 // void cleanupExtraDataEventHandler() {} 83 70 84 /** Singleton Extra-data Manager instance. */ 71 85 static UIExtraDataManager *m_pInstance;
Note:
See TracChangeset
for help on using the changeset viewer.