VirtualBox

Ignore:
Timestamp:
Sep 20, 2021 12:29:18 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146975
Message:

Main: bugref:1909: Fixed compilation issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r91312 r91314  
    599599
    600600            char szNlsPath[RTPATH_MAX];
    601             rc = RTPathAppPrivateNoArch(szNlsPath, sizeof(szNlsPath));
    602             if (RT_SUCCESS(rc))
    603                 rc = RTPathAppend(szNlsPath, sizeof(szNlsPath), "nls" RTPATH_SLASH_STR "VirtualBoxAPI");
    604 
    605             int vrc = m->pVBoxTranslator->registerTranslation(szNlsPath, true, &m->pTrComponent);
     601            int vrc = RTPathAppPrivateNoArch(szNlsPath, sizeof(szNlsPath));
     602            if (RT_SUCCESS(vrc))
     603                vrc = RTPathAppend(szNlsPath, sizeof(szNlsPath), "nls" RTPATH_SLASH_STR "VirtualBoxAPI");
     604
    606605            if (RT_SUCCESS(vrc))
    607606            {
    608                 com::Utf8Str strLocale;
    609                 HRESULT hrc = m->pSystemProperties->getLanguageId(strLocale);
    610                 if (SUCCEEDED(hrc))
     607                vrc = m->pVBoxTranslator->registerTranslation(szNlsPath, true, &m->pTrComponent);
     608                if (RT_SUCCESS(vrc))
    611609                {
    612                     vrc = m->pVBoxTranslator->i_loadLanguage(strLocale.c_str());
    613                     if (RT_FAILURE(vrc))
     610                    com::Utf8Str strLocale;
     611                    HRESULT hrc = m->pSystemProperties->getLanguageId(strLocale);
     612                    if (SUCCEEDED(hrc))
    614613                    {
    615                         hrc = Global::vboxStatusCodeToCOM(vrc);
    616                         LogRel(("Load language failed (%Rhrc).\n", hrc));
     614                        vrc = m->pVBoxTranslator->i_loadLanguage(strLocale.c_str());
     615                        if (RT_FAILURE(vrc))
     616                        {
     617                            hrc = Global::vboxStatusCodeToCOM(vrc);
     618                            LogRel(("Load language failed (%Rhrc).\n", hrc));
     619                        }
     620                    }
     621                    else
     622                    {
     623                        LogRel(("Getting language settings failed (%Rhrc).\n", hrc));
     624                        m->pVBoxTranslator->release();
     625                        m->pVBoxTranslator = NULL;
     626                        m->pTrComponent = NULL;
    617627                    }
    618628                }
    619629                else
    620630                {
    621                     LogRel(("Getting language settings failed (%Rhrc).\n", hrc));
     631                    HRESULT hrc = Global::vboxStatusCodeToCOM(vrc);
     632                    LogRel(("Register translation failed (%Rhrc).\n", hrc));
    622633                    m->pVBoxTranslator->release();
    623634                    m->pVBoxTranslator = NULL;
     
    628639            {
    629640                HRESULT hrc = Global::vboxStatusCodeToCOM(vrc);
    630                 LogRel(("Register translation failed (%Rhrc).\n", hrc));
     641                LogRel(("Path constructing failed (%Rhrc).\n", hrc));
    631642                m->pVBoxTranslator->release();
    632643                m->pVBoxTranslator = NULL;
Note: See TracChangeset for help on using the changeset viewer.

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