Changeset 24417 in vbox
- Timestamp:
- Nov 5, 2009 10:38:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp
r24395 r24417 65 65 66 66 67 KDeviceType typeToGlobal (VBoxDefs::MediumType aType)68 {69 KDeviceType result = KDeviceType_Null;70 switch (aType)71 {72 case VBoxDefs::MediumType_HardDisk:73 result = KDeviceType_HardDisk;74 break;75 case VBoxDefs::MediumType_DVD:76 result = KDeviceType_DVD;77 break;78 case VBoxDefs::MediumType_Floppy:79 result = KDeviceType_Floppy;80 break;81 default:82 AssertMsgFailed (("Incorrect device type!\n"));83 break;84 }85 return result;86 }87 88 67 QString compressText (const QString &aText) 89 68 { … … 323 302 } 324 303 325 void AbstractItem::setMachineId (const QString &aM chineId)326 { 327 mMachineId = aM chineId;304 void AbstractItem::setMachineId (const QString &aMachineId) 305 { 306 mMachineId = aMachineId; 328 307 } 329 308 … … 498 477 QStringList ControllerItem::ctrAllMediumIds (bool aShowDiffs) const 499 478 { 500 QStringList allImages; 501 for (VBoxMediaList::const_iterator it = vboxGlobal().currentMediaList().begin(); 502 it != vboxGlobal().currentMediaList().end(); ++ it) 503 { 504 foreach (KDeviceType deviceType, mCtrType->deviceTypeList()) 479 QStringList allMediums; 480 foreach (const VBoxMedium &medium, vboxGlobal().currentMediaList()) 481 { 482 foreach (const KDeviceType &deviceType, mCtrType->deviceTypeList()) 505 483 { 506 if ( (*it).isNull() || typeToGlobal ((*it).type()) == deviceType)484 if (medium.isNull() || medium.medium().GetDeviceType() == deviceType) 507 485 { 508 /* We should filter out the base hard-disk of diff-disks, 509 * as we want to insert here a diff-disks and want 510 * to avoid duplicates in !aShowDiffs mode. */ 511 if (!aShowDiffs && (*it).parent() && !parent()->machineId().isNull() && 512 (*it).isAttachedInCurStateTo (parent()->machineId())) 513 allImages.removeAll ((*it).root().id()); 514 allImages << (*it).id(); 486 /* In 'don't show diffs' mode we should filter out all the mediums 487 * which are already attached to some snapshot of current VM. */ 488 if (!aShowDiffs && medium.type() == VBoxDefs::MediumType_HardDisk) 489 { 490 if (!medium.medium().GetMachineIds().contains (parent()->machineId()) || 491 medium.isAttachedInCurStateTo (parent()->machineId())) 492 allMediums << medium.id(); 493 } 494 else allMediums << medium.id(); 515 495 break; 516 496 } 517 497 } 518 498 } 519 return all Images;499 return allMediums; 520 500 } 521 501 … … 665 645 VBoxMedium medium = vboxGlobal().findMedium (mediumId); 666 646 if ((medium.isNull() && mAttDeviceType != KDeviceType_HardDisk) || 667 (!medium.isNull() && typeToGlobal (medium.type()) == mAttDeviceType))647 (!medium.isNull() && medium.medium().GetDeviceType() == mAttDeviceType)) 668 648 allMediumIds << mediumId; 669 649 }
Note:
See TracChangeset
for help on using the changeset viewer.