VirtualBox

Ignore:
Timestamp:
Oct 14, 2022 8:02:41 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154124
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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.

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