Changeset 103918 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 19, 2024 1:44:53 PM (12 months ago)
- svn:sync-xref-src-repo-rev:
- 162292
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp ¶
r103914 r103918 306 306 retranslateUi(); 307 307 308 m_pTranlationEventListener = new UITranslationEventListener(this); 308 /* Create translation event listener instance: */ 309 UITranslationEventListener::create(); 309 310 310 311 connect(gEDataManager, &UIExtraDataManager::sigLanguageChange, … … 842 843 /* Destroy desktop-widget watchdog: */ 843 844 UIDesktopWidgetWatchdog::destroy(); 845 846 /* Destroy translation event listener instance: */ 847 UITranslationEventListener::destroy(); 844 848 845 849 m_fValid = false; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UITranslationEventListener.cpp ¶
r103914 r103918 33 33 #include "UITranslator.h" 34 34 35 /* static */ 36 UITranslationEventListener *UITranslationEventListener::s_pInstance = 0; 37 38 UITranslationEventListener *UITranslationEventListener::instance() 39 { 40 return s_pInstance; 41 } 42 43 /* static */ 44 void UITranslationEventListener::create() 45 { 46 /* Make sure instance is NOT created yet: */ 47 if (s_pInstance) 48 return; 49 50 /* Create instance: */ 51 new UITranslationEventListener; 52 } 53 54 /* static */ 55 void UITranslationEventListener::destroy() 56 { 57 /* Make sure instance is NOT destroyed yet: */ 58 if (!s_pInstance) 59 return; 60 61 /* Destroy instance: */ 62 delete s_pInstance; 63 } 35 64 36 65 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/globals/UITranslationEventListener.h ¶
r103914 r103918 47 47 public: 48 48 49 UITranslationEventListener(QObject *pParent = 0); 49 /** Creates message-center singleton. */ 50 static void create(); 51 /** Destroys message-center singleton. */ 52 static void destroy(); 50 53 51 54 protected: 52 55 53 56 bool eventFilter(QObject *pObject, QEvent *pEvent) override final; 57 58 private: 59 60 UITranslationEventListener(QObject *pParent = 0); 61 62 static UITranslationEventListener *s_pInstance; 63 /** Returns the singleton instance. */ 64 static UITranslationEventListener *instance(); 65 /** Allows for shortcut access. */ 66 friend UITranslationEventListener &translationEventListener(); 67 54 68 }; 55 69 70 inline UITranslationEventListener &translationEventListener() { return *UITranslationEventListener::instance(); } 71 56 72 #endif /* !FEQT_INCLUDED_SRC_globals_UITranslationEventListener_h */
Note:
See TracChangeset
for help on using the changeset viewer.