VirtualBox

Changeset 9819 in vbox


Ignore:
Timestamp:
Jun 19, 2008 12:37:14 PM (17 years ago)
Author:
vboxsync
Message:

Fe/Qt4: correct porting of qt3::QString::ucs2() to qt4::QString::utf16() in all places which may be not correct in all places but at least now similar to qt3.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/COMDefs.h

    r9425 r9819  
    322322    public:
    323323
    324         BSTRIn (const QString &s) : bstr (SysAllocString ((const OLECHAR *) s.utf16())) {}
     324        BSTRIn (const QString &s) : bstr (SysAllocString ((const OLECHAR *)
     325            (s.isNull() ? 0 : s.utf16()))) {}
    325326
    326327        ~BSTRIn()
  • trunk/src/VBox/Frontends/VirtualBox4/src/COMDefs.cpp

    r9426 r9819  
    191191{
    192192    aArr.reset (aVec.size());
    193     for (int i = 0; i < aVec.size(); ++i)
    194         aArr [i] = SysAllocString ((const OLECHAR *) aVec.at (i).utf16());
     193    for (int i = 0; i < aVec.size(); ++ i)
     194        aArr [i] = SysAllocString ((const OLECHAR *)
     195            (aVec.at (i).isNull() ? 0 : aVec.at (i).utf16()));
    195196}
    196197
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r9524 r9819  
    246246                        /* disallow the change when there is an error*/
    247247                        *error = SysAllocString ((const OLECHAR *)
    248                                                  gs.lastError().utf16());
     248                            (gs.lastError().isNull() ? 0 : gs.lastError().utf16()));
    249249                        *allowChange = FALSE;
    250250                    }
     
    484484        if (!initDir->isEmpty())
    485485        {
    486             SendMessage (hwnd, BFFM_SETSELECTION, TRUE, Q_ULONG (initDir->utf16()));
     486            SendMessage (hwnd, BFFM_SETSELECTION, TRUE, Q_ULONG (
     487                initDir.isNull() ? 0 : initDir->utf16()));
    487488            //SendMessage (hwnd, BFFM_SETEXPANDED, TRUE, Q_ULONG (initDir->utf16()));
    488489        }
     
    32613262            bi.hwndOwner = topParent ? topParent->winId() : 0;
    32623263            bi.pidlRoot = NULL;
    3263             bi.lpszTitle = (TCHAR*)title.utf16();
     3264            bi.lpszTitle = (TCHAR*)(title.isNull() ? 0 : title.utf16());
    32643265            bi.pszDisplayName = initPath;
    32653266            bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_NEWDIALOGSTYLE;
     
    34123413            TCHAR buf [1024];
    34133414            if (initSel.length() > 0 && initSel.length() < sizeof (buf))
    3414                 memcpy (buf, initSel.utf16(), (initSel.length() + 1) * sizeof (TCHAR));
     3415                memcpy (buf, initSel.isNull() ? 0 : initSel.utf16(),
     3416                        (initSel.length() + 1) * sizeof (TCHAR));
    34153417            else
    34163418                buf [0] = 0;
     
    34213423            ofn.lStructSize = sizeof (OPENFILENAME);
    34223424            ofn.hwndOwner = topParent ? topParent->winId() : 0;
    3423             ofn.lpstrFilter = (TCHAR *) winFilters.utf16();
     3425            ofn.lpstrFilter = (TCHAR *) winFilters.isNull() ? 0 : winFilters.utf16();
    34243426            ofn.lpstrFile = buf;
    34253427            ofn.nMaxFile = sizeof (buf) - 1;
    3426             ofn.lpstrInitialDir = (TCHAR *) workDir.utf16();
    3427             ofn.lpstrTitle = (TCHAR *) title.utf16();
     3428            ofn.lpstrInitialDir = (TCHAR *) workDir.isNull() ? 0 : workDir.utf16();
     3429            ofn.lpstrTitle = (TCHAR *) title.isNull() ? 0 : title.utf16();
    34283430            ofn.Flags = (OFN_NOCHANGEDIR | OFN_HIDEREADONLY |
    34293431                          OFN_EXPLORER | OFN_ENABLEHOOK |
     
    37563758        void run()
    37573759        {
    3758             int rc = (int) ShellExecute (NULL, NULL, mURL.utf16(), NULL, NULL, SW_SHOW);
     3760            int rc = (int) ShellExecute (NULL, NULL, mURL.isNull() ? 0 : mURL.utf16(),
     3761                                         NULL, NULL, SW_SHOW);
    37593762            bool ok = rc > 32;
    37603763            QApplication::postEvent
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