Changeset 9819 in vbox
- Timestamp:
- Jun 19, 2008 12:37:14 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/COMDefs.h
r9425 r9819 322 322 public: 323 323 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()))) {} 325 326 326 327 ~BSTRIn() -
trunk/src/VBox/Frontends/VirtualBox4/src/COMDefs.cpp
r9426 r9819 191 191 { 192 192 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())); 195 196 } 196 197 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r9524 r9819 246 246 /* disallow the change when there is an error*/ 247 247 *error = SysAllocString ((const OLECHAR *) 248 gs.lastError().utf16());248 (gs.lastError().isNull() ? 0 : gs.lastError().utf16())); 249 249 *allowChange = FALSE; 250 250 } … … 484 484 if (!initDir->isEmpty()) 485 485 { 486 SendMessage (hwnd, BFFM_SETSELECTION, TRUE, Q_ULONG (initDir->utf16())); 486 SendMessage (hwnd, BFFM_SETSELECTION, TRUE, Q_ULONG ( 487 initDir.isNull() ? 0 : initDir->utf16())); 487 488 //SendMessage (hwnd, BFFM_SETEXPANDED, TRUE, Q_ULONG (initDir->utf16())); 488 489 } … … 3261 3262 bi.hwndOwner = topParent ? topParent->winId() : 0; 3262 3263 bi.pidlRoot = NULL; 3263 bi.lpszTitle = (TCHAR*) title.utf16();3264 bi.lpszTitle = (TCHAR*)(title.isNull() ? 0 : title.utf16()); 3264 3265 bi.pszDisplayName = initPath; 3265 3266 bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_NEWDIALOGSTYLE; … … 3412 3413 TCHAR buf [1024]; 3413 3414 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)); 3415 3417 else 3416 3418 buf [0] = 0; … … 3421 3423 ofn.lStructSize = sizeof (OPENFILENAME); 3422 3424 ofn.hwndOwner = topParent ? topParent->winId() : 0; 3423 ofn.lpstrFilter = (TCHAR *) winFilters. utf16();3425 ofn.lpstrFilter = (TCHAR *) winFilters.isNull() ? 0 : winFilters.utf16(); 3424 3426 ofn.lpstrFile = buf; 3425 3427 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(); 3428 3430 ofn.Flags = (OFN_NOCHANGEDIR | OFN_HIDEREADONLY | 3429 3431 OFN_EXPLORER | OFN_ENABLEHOOK | … … 3756 3758 void run() 3757 3759 { 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); 3759 3762 bool ok = rc > 32; 3760 3763 QApplication::postEvent
Note:
See TracChangeset
for help on using the changeset viewer.