VirtualBox

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


Ignore:
Timestamp:
Oct 14, 2022 8:02:41 AM (2 years ago)
Author:
vboxsync
Message:

Main/Guest Control: Resolved some @todos: Got rid of using separate Utf8Str instances when assigning format strings; instead use .printf() for that. bugref:10286

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r96617 r97151  
    18661866    {
    18671867        case VERR_INVALID_VM_HANDLE:
    1868             strError += Utf8StrFmt(tr("VMM device is not available (is the VM running?)"));
     1868            strError.printf(tr("VMM device is not available (is the VM running?)"));
    18691869            break;
    18701870
    18711871        case VERR_HGCM_SERVICE_NOT_FOUND:
    1872             strError += Utf8StrFmt(tr("The guest execution service is not available"));
     1872            strError.printf(tr("The guest execution service is not available"));
    18731873            break;
    18741874
    18751875        case VERR_ACCOUNT_RESTRICTED:
    1876             strError += Utf8StrFmt(tr("The specified user account on the guest is restricted and can't be used to logon"));
     1876            strError.printf(tr("The specified user account on the guest is restricted and can't be used to logon"));
    18771877            break;
    18781878
    18791879        case VERR_AUTHENTICATION_FAILURE:
    1880             strError += Utf8StrFmt(tr("The specified user was not able to logon on guest"));
     1880            strError.printf(tr("The specified user was not able to logon on guest"));
    18811881            break;
    18821882
    18831883        case VERR_TIMEOUT:
    1884             strError += Utf8StrFmt(tr("The guest did not respond within time"));
     1884            strError.printf(tr("The guest did not respond within time"));
    18851885            break;
    18861886
    18871887        case VERR_CANCELLED:
    1888             strError += Utf8StrFmt(tr("The session operation was canceled"));
     1888            strError.printf(tr("The session operation was canceled"));
    18891889            break;
    18901890
    18911891        case VERR_GSTCTL_MAX_CID_OBJECTS_REACHED:
    1892             strError += Utf8StrFmt(tr("Maximum number of concurrent guest processes has been reached"));
     1892            strError.printf(tr("Maximum number of concurrent guest processes has been reached"));
    18931893            break;
    18941894
    18951895        case VERR_NOT_FOUND:
    1896             strError += Utf8StrFmt(tr("The guest execution service is not ready (yet)"));
     1896            strError.printf(tr("The guest execution service is not ready (yet)"));
    18971897            break;
    18981898
    18991899        default:
    1900             strError += Utf8StrFmt("%Rrc", rcGuest);
     1900            strError.printf("%Rrc", rcGuest);
    19011901            break;
    19021902    }
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r97139 r97151  
    14491449    if (mDest.isEmpty())
    14501450    {
    1451         strErrorInfo = Utf8StrFmt(tr("Host destination must not be empty"));
     1451        strErrorInfo.printf(tr("Host destination must not be empty"));
    14521452        vrc = VERR_INVALID_PARAMETER;
    14531453    }
     
    14641464            if (strSrc.isEmpty())
    14651465            {
    1466                 strErrorInfo = Utf8StrFmt(tr("Guest source entry must not be empty"));
     1466                strErrorInfo.printf(tr("Guest source entry must not be empty"));
    14671467                vrc = VERR_INVALID_PARAMETER;
    14681468                break;
     
    15011501                                                               GuestErrorInfo(GuestErrorInfo::Type_ToolStat, vrcGuest, strSrc.c_str()));
    15021502                else
    1503                     strErrorInfo = Utf8StrFmt(tr("Guest file lookup for \"%s\" failed: %Rrc"),
    1504                                               strSrc.c_str(), vrc);
     1503                    strErrorInfo.printf(tr("Guest file lookup for \"%s\" failed: %Rrc"),
     1504                                        strSrc.c_str(), vrc);
    15051505                break;
    15061506            }
     
    15101510                if (itSrc->enmType != FsObjType_Directory)
    15111511                {
    1512                     strErrorInfo = Utf8StrFmt(tr("Guest source is not a file: %s"), strSrc.c_str());
     1512                    strErrorInfo.printf(tr("Guest source is not a file: %s"), strSrc.c_str());
    15131513                    vrc = VERR_NOT_A_FILE;
    15141514                    break;
     
    15191519                if (itSrc->enmType != FsObjType_File)
    15201520                {
    1521                     strErrorInfo = Utf8StrFmt(tr("Guest source is not a directory: %s"), strSrc.c_str());
     1521                    strErrorInfo.printf(tr("Guest source is not a directory: %s"), strSrc.c_str());
    15221522                    vrc = VERR_NOT_A_DIRECTORY;
    15231523                    break;
     
    15411541                {
    15421542                    delete pFsList;
    1543                     strErrorInfo = Utf8StrFmt(tr("Error adding guest source '%s' to list: %Rrc"),
    1544                                               strSrc.c_str(), vrc);
     1543                    strErrorInfo.printf(tr("Error adding guest source '%s' to list: %Rrc"),
     1544                                        strSrc.c_str(), vrc);
    15451545                    break;
    15461546                }
     
    15771577    {
    15781578        if (strErrorInfo.isEmpty())
    1579             strErrorInfo = Utf8StrFmt(tr("Failed with %Rrc"), vrc);
     1579            strErrorInfo.printf(tr("Failed with %Rrc"), vrc);
    15801580        setProgressErrorMsg(VBOX_E_IPRT_ERROR, strErrorInfo);
    15811581    }
     
    17521752    if (mDest.isEmpty())
    17531753    {
    1754         strErrorInfo = Utf8StrFmt(tr("Guest destination must not be empty"));
     1754        strErrorInfo.printf(tr("Guest destination must not be empty"));
    17551755        vrc = VERR_INVALID_PARAMETER;
    17561756    }
     
    17671767            if (strSrc.isEmpty())
    17681768            {
    1769                 strErrorInfo = Utf8StrFmt(tr("Host source entry must not be empty"));
     1769                strErrorInfo.printf(tr("Host source entry must not be empty"));
    17701770                vrc = VERR_INVALID_PARAMETER;
    17711771                break;
     
    17761776            if (RT_FAILURE(vrc))
    17771777            {
    1778                 strErrorInfo = Utf8StrFmt(tr("No such host file/directory: %s"), strSrc.c_str());
     1778                strErrorInfo.printf(tr("No such host file/directory: %s"), strSrc.c_str());
    17791779                break;
    17801780            }
     
    17841784                if (itSrc->enmType != FsObjType_Directory)
    17851785                {
    1786                     strErrorInfo = Utf8StrFmt(tr("Host source is not a file: %s"), strSrc.c_str());
     1786                    strErrorInfo.printf(tr("Host source is not a file: %s"), strSrc.c_str());
    17871787                    vrc = VERR_NOT_A_FILE;
    17881788                    break;
     
    17931793                if (itSrc->enmType == FsObjType_Directory)
    17941794                {
    1795                     strErrorInfo = Utf8StrFmt(tr("Host source is not a directory: %s"), strSrc.c_str());
     1795                    strErrorInfo.printf(tr("Host source is not a directory: %s"), strSrc.c_str());
    17961796                    vrc = VERR_NOT_A_DIRECTORY;
    17971797                    break;
     
    18181818                {
    18191819                    delete pFsList;
    1820                     strErrorInfo = Utf8StrFmt(tr("Error adding host source '%s' to list: %Rrc"),
    1821                                               strSrc.c_str(), vrc);
     1820                    strErrorInfo.printf(tr("Error adding host source '%s' to list: %Rrc"),
     1821                                        strSrc.c_str(), vrc);
    18221822                    break;
    18231823                }
     
    18541854    {
    18551855        if (strErrorInfo.isEmpty())
    1856             strErrorInfo = Utf8StrFmt(tr("Failed with %Rrc"), vrc);
     1856            strErrorInfo.printf(tr("Failed with %Rrc"), vrc);
    18571857        setProgressErrorMsg(VBOX_E_IPRT_ERROR, strErrorInfo);
    18581858    }
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