Changeset 73931 in vbox
- Timestamp:
- Aug 28, 2018 6:59:00 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/medium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r73926 r73931 145 145 UIMediumMap media; 146 146 addNullMediumToMap(media); 147 add HardDisksToMap(vboxGlobal().virtualBox().GetHardDisks(), media);148 addMediaToMap(vboxGlobal().host().GetDVDDrives(), media , UIMediumType_DVD);149 addMediaToMap(vboxGlobal().virtualBox().GetDVDImages(), media , UIMediumType_DVD);150 addMediaToMap(vboxGlobal().host().GetFloppyDrives(), media , UIMediumType_Floppy);151 addMediaToMap(vboxGlobal().virtualBox().GetFloppyImages(), media , UIMediumType_Floppy);147 addMediaToMap(vboxGlobal().virtualBox().GetHardDisks(), media); 148 addMediaToMap(vboxGlobal().host().GetDVDDrives(), media); 149 addMediaToMap(vboxGlobal().virtualBox().GetDVDImages(), media); 150 addMediaToMap(vboxGlobal().host().GetFloppyDrives(), media); 151 addMediaToMap(vboxGlobal().virtualBox().GetFloppyImages(), media); 152 152 if (VBoxGlobal::isCleaningUp()) 153 153 return; /* VBoxGlobal is cleaning up, abort immediately. */ … … 378 378 } 379 379 380 void UIMediumEnumerator::addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia , UIMediumType mediumType)380 void UIMediumEnumerator::addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia) 381 381 { 382 382 /* Insert hard-disks to the passed uimedium map. … … 391 391 QString strMediumID = medium.GetId(); 392 392 UIMedium uimedium = m_media.contains(strMediumID) ? m_media[strMediumID] : 393 UIMedium(medium, mediumType);393 UIMedium(medium, UIMediumDefs::mediumTypeToLocal(medium.GetDeviceType())); 394 394 395 395 /* Insert uimedium into map: */ 396 396 outputMedia.insert(uimedium.id(), uimedium); 397 }398 }399 400 void UIMediumEnumerator::addHardDisksToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia)401 {402 /* Insert hard-disks to the passed uimedium map.403 * Get existing one from the previous map if any. */404 foreach (CMedium medium, inputMedia)405 {406 /* If VBoxGlobal is cleaning up, abort immediately: */407 if (VBoxGlobal::isCleaningUp())408 break;409 410 /* Prepare uimedium on the basis of current medium: */411 QString strMediumID = medium.GetId();412 UIMedium uimedium = m_media.contains(strMediumID) ? m_media[strMediumID] :413 UIMedium(medium, UIMediumType_HardDisk);414 415 /* Insert uimedium into map: */416 outputMedia.insert(uimedium.id(), uimedium);417 397 418 398 /* Insert medium children into map too: */ 419 add HardDisksToMap(medium.GetChildren(), outputMedia);399 addMediaToMap(medium.GetChildren(), outputMedia); 420 400 } 421 401 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r73926 r73931 88 88 void createMediumEnumerationTask(const UIMedium &medium); 89 89 void addNullMediumToMap(UIMediumMap &media); 90 void addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia, UIMediumType mediumType); 91 void addHardDisksToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia); 90 void addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia); 92 91 93 92 /* Helpers: Medium re-caching stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.