VirtualBox

Changeset 90881 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 25, 2021 1:28:50 PM (3 years ago)
Author:
vboxsync
Message:

Main: bugref:1909: Some improvements in translation event handling

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/VirtualBoxTranslator.h

    r90828 r90881  
    3838
    3939    static VirtualBoxTranslator *instance();
     40    /* Returns instance if exists, returns NULL otherwise. */
     41    static VirtualBoxTranslator *tryInstance();
    4042    void release();
    4143
     
    9092                            const int   aNum = -1);
    9193
    92     /* Returns instance if exists, returns NULL otherwise. */
    93     static VirtualBoxTranslator *i_instance();
    9494};
    9595
  • trunk/src/VBox/Main/src-all/VirtualBoxTranslator.cpp

    r90828 r90881  
    143143
    144144/* static */
    145 VirtualBoxTranslator *VirtualBoxTranslator::i_instance()
     145VirtualBoxTranslator *VirtualBoxTranslator::tryInstance()
    146146{
    147147    int rc = RTOnce(&g_Once, initLock, NULL);
     
    322322                                            const int   aNum)
    323323{
    324     VirtualBoxTranslator *pCurrInstance = VirtualBoxTranslator::i_instance();
     324    VirtualBoxTranslator *pCurrInstance = VirtualBoxTranslator::tryInstance();
    325325    const char *pszTranslation = aSourceText;
    326326    if (pCurrInstance != NULL)
     
    384384{
    385385    const char *pszSource = aTranslation;
    386     VirtualBoxTranslator *pCurInstance = VirtualBoxTranslator::i_instance(); /* paranoia */
     386    VirtualBoxTranslator *pCurInstance = VirtualBoxTranslator::tryInstance(); /* paranoia */
    387387    if (pCurInstance != NULL)
    388388    {
  • trunk/src/VBox/Main/src-client/VirtualBoxClientImpl.cpp

    r90879 r90881  
    8484            case VBoxEventType_OnLanguageChanged:
    8585            {
    86                 VirtualBoxTranslator *pTranslator = VirtualBoxTranslator::instance();
     86                VirtualBoxTranslator *pTranslator = VirtualBoxTranslator::tryInstance();
    8787                if (pTranslator)
    8888                {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette