Changeset 16966 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 20, 2009 9:14:28 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r16867 r16966 1438 1438 /* now VM mappings */ 1439 1439 { 1440 ComPtr<ISharedFolderCollection> sfColl; 1441 ComPtr<ISharedFolderEnumerator> sfEnum; 1442 CHECK_ERROR_RET(machine, COMGETTER(SharedFolders)(sfColl.asOutParam()), rc); 1443 CHECK_ERROR_RET(sfColl, Enumerate(sfEnum.asOutParam()), rc); 1440 com::SafeIfaceArray <ISharedFolder> folders; 1441 1442 CHECK_ERROR_RET(machine, COMGETTER(SharedFolders)(ComSafeArrayAsOutParam(folders)), rc); 1444 1443 ULONG index = 0; 1445 BOOL fMore; 1446 sfEnum->HasMore(&fMore); 1447 while (fMore) 1448 { 1449 ComPtr<ISharedFolder> sf; 1450 CHECK_ERROR_RET(sfEnum, GetNext(sf.asOutParam()), rc); 1444 1445 for (size_t i = 0; i < folders.size(); ++i) 1446 { 1447 ComPtr <ISharedFolder> sf = folders[i]; 1448 1451 1449 Bstr name, hostPath; 1452 1450 BOOL writable; … … 1467 1465 name.raw(), hostPath.raw(), writable ? "writable" : "readonly"); 1468 1466 ++numSharedFolders; 1469 CHECK_ERROR_RET(sfEnum, HasMore(&fMore), rc);1470 1467 } 1471 1468 } … … 1473 1470 if (console) 1474 1471 { 1475 ComPtr<ISharedFolderCollection> sfColl; 1476 ComPtr<ISharedFolderEnumerator> sfEnum; 1477 CHECK_ERROR_RET(console, COMGETTER(SharedFolders)(sfColl.asOutParam()), rc); 1478 CHECK_ERROR_RET(sfColl, Enumerate(sfEnum.asOutParam()), rc); 1472 com::SafeIfaceArray <ISharedFolder> folders; 1473 1474 CHECK_ERROR_RET(console, COMGETTER(SharedFolders)(ComSafeArrayAsOutParam(folders)), rc); 1479 1475 ULONG index = 0; 1480 BOOL fMore; 1481 sfEnum->HasMore(&fMore); 1482 while (fMore) 1483 { 1484 ComPtr<ISharedFolder> sf; 1485 CHECK_ERROR_RET(sfEnum, GetNext(sf.asOutParam()), rc); 1476 1477 for (size_t i = 0; i < folders.size(); ++i) 1478 { 1479 ComPtr <ISharedFolder> sf = folders[i]; 1480 1486 1481 Bstr name, hostPath; 1487 1482 sf->COMGETTER(Name)(name.asOutParam()); … … 1499 1494 RTPrintf("Name: '%lS', Host path: '%lS' (transient mapping)\n", name.raw(), hostPath.raw()); 1500 1495 ++numSharedFolders; 1501 CHECK_ERROR_RET(sfEnum, HasMore(&fMore), rc);1502 1496 } 1503 1497 } -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsSF.h
r10742 r16966 91 91 SFDialogType aType); 92 92 93 void getFrom (const CSharedFolder Enumerator &aEn, SFTreeViewItem *aItem);94 void putBackTo (CSharedFolderEnumerator &aEn, SFTreeViewItem *aItem);93 void getFrom (const CSharedFolderVector &aVec, SFTreeViewItem *aItem); 94 void putBackTo (CSharedFolderVector &aVec, SFTreeViewItem *aItem); 95 95 96 96 SFTreeViewItem* searchRoot (bool aIsPermanent, … … 112 112 113 113 #endif // __VBoxVMSettingsSF_h__ 114 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r16942 r16966 745 745 746 746 #ifdef Q_WS_MAC 747 /* We have to make sure that we are get the front most process. This is747 /* We have to make sure that we are getting the front most process. This is 748 748 * necessary for Qt versions > 4.3.3 */ 749 749 ProcessSerialNumber psn = { 0, kCurrentProcess }; … … 911 911 912 912 /* initialize shared folders stuff */ 913 CSharedFolder Collection sfcoll= cconsole.GetSharedFolders();914 if (sf coll.isNull())913 CSharedFolderVector sfvec = cconsole.GetSharedFolders(); 914 if (sfvec.size() == 0) 915 915 { 916 916 /* hide shared folders menu action & sf_separator & sf_status_icon */ … … 2047 2047 2048 2048 /* permanent folders */ 2049 CSharedFolderEnumerator en = cmachine.GetSharedFolders().Enumerate(); 2050 while (en.HasMore()) 2051 { 2052 CSharedFolder sf = en.GetNext(); 2049 CSharedFolderVector psfvec = cmachine.GetSharedFolders(); 2050 2051 for (int i = 0; i < psfvec.size(); ++i) 2052 { 2053 CSharedFolder sf = psfvec[i]; 2053 2054 sfs.insert (sf.GetName(), sf.GetHostPath()); 2054 2055 } 2056 2055 2057 /* transient folders */ 2056 en = cconsole.GetSharedFolders().Enumerate(); 2057 while (en.HasMore()) 2058 { 2059 CSharedFolder sf = en.GetNext(); 2058 CSharedFolderVector tsfvec = cconsole.GetSharedFolders(); 2059 2060 for (int i = 0; i < tsfvec.size(); ++i) 2061 { 2062 CSharedFolder sf = tsfvec[i]; 2060 2063 sfs.insert (sf.GetName(), sf.GetHostPath()); 2061 2064 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r16873 r16966 2543 2543 /* Shared folders */ 2544 2544 { 2545 ulong count = aMachine.GetSharedFolders(). GetCount();2545 ulong count = aMachine.GetSharedFolders().size(); 2546 2546 if (count > 0) 2547 2547 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsSF.cpp
r11776 r16966 272 272 //SFTreeViewItem *root = searchRoot (true, GlobalType); 273 273 //root->setHidden (false); 274 //getFrom (vboxGlobal().virtualBox().GetSharedFolders() .Enumerate(), root);274 //getFrom (vboxGlobal().virtualBox().GetSharedFolders(), root); 275 275 } 276 276 … … 280 280 SFTreeViewItem *root = searchRoot (true, MachineType); 281 281 root->setHidden (false); 282 getFrom (mMachine.GetSharedFolders() .Enumerate(), root);282 getFrom (mMachine.GetSharedFolders(), root); 283 283 } 284 284 … … 288 288 SFTreeViewItem *root = searchRoot (true, ConsoleType); 289 289 root->setHidden (false); 290 getFrom (mConsole.GetSharedFolders() .Enumerate(), root);290 getFrom (mConsole.GetSharedFolders(), root); 291 291 } 292 292 … … 303 303 //SFTreeViewItem *root = searchRoot (true, GlobalType); 304 304 //Assert (root); 305 //CSharedFolder Enumerator en=306 // vboxGlobal().virtualBox().GetSharedFolders() .Enumerate();307 //putBackTo ( en, root);305 //CSharedFolderVector vec = 306 // vboxGlobal().virtualBox().GetSharedFolders(); 307 //putBackTo (vec, root); 308 308 } 309 309 … … 318 318 SFTreeViewItem *root = searchRoot (true, MachineType); 319 319 Assert (root); 320 CSharedFolder Enumerator en = mMachine.GetSharedFolders().Enumerate();321 putBackTo ( en, root);320 CSharedFolderVector sfvec = mMachine.GetSharedFolders(); 321 putBackTo (sfvec, root); 322 322 } 323 323 … … 332 332 SFTreeViewItem *root = searchRoot (true, ConsoleType); 333 333 Assert (root); 334 CSharedFolder Enumerator en = mConsole.GetSharedFolders().Enumerate();335 putBackTo ( en, root);334 CSharedFolderVector sfvec = mConsole.GetSharedFolders(); 335 putBackTo (sfvec, root); 336 336 } 337 337 … … 622 622 623 623 624 void VBoxVMSettingsSF::getFrom (const CSharedFolder Enumerator &aEn,624 void VBoxVMSettingsSF::getFrom (const CSharedFolderVector &aVec, 625 625 SFTreeViewItem *aRoot) 626 626 { 627 while (aEn.HasMore())628 { 629 CSharedFolder sf = a En.GetNext();627 for (int i = 0; i < aVec.size(); ++i) 628 { 629 CSharedFolder sf = aVec[i]; 630 630 QStringList fields; 631 631 fields << sf.GetName() /* name */ … … 641 641 } 642 642 643 void VBoxVMSettingsSF::putBackTo (CSharedFolder Enumerator &aEn,643 void VBoxVMSettingsSF::putBackTo (CSharedFolderVector &aVec, 644 644 SFTreeViewItem *aRoot) 645 645 { … … 648 648 649 649 /* delete all changed folders from vm */ 650 while (aEn.HasMore())651 { 652 CSharedFolder sf = a En.GetNext();650 for (int idx = 0; idx < aVec.size(); ++idx) 651 { 652 CSharedFolder sf = aVec[idx]; 653 653 654 654 /* Iterate through this root's children */
Note:
See TracChangeset
for help on using the changeset viewer.