Changeset 24419 in vbox for trunk/src/VBox
- Timestamp:
- Nov 5, 2009 11:32:59 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsHD.h
r24395 r24419 467 467 void delController (const QUuid &aCtrId); 468 468 469 QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType );469 QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, bool aVerbose); 470 470 void delAttachment (const QUuid &aCtrId, const QUuid &aAttId); 471 471 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp
r24417 r24419 504 504 QStringList usedImages; 505 505 for (int i = 0; i < mAttachments.size(); ++ i) 506 usedImages << static_cast <AttachmentItem*> (mAttachments [i])->attMediumId(); 506 { 507 QString usedMediumId = static_cast <AttachmentItem*> (mAttachments [i])->attMediumId(); 508 if (!vboxGlobal().findMedium (usedMediumId).isNull()) 509 usedImages << usedMediumId; 510 } 507 511 return usedImages; 508 512 } … … 1352 1356 } 1353 1357 1354 QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType )1358 QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, bool aVerbose) 1355 1359 { 1356 1360 if (AbstractItem *parent = mRootItem->childById (aCtrId)) … … 1359 1363 QModelIndex parentIndex = index (parentPosition, 0, root()); 1360 1364 beginInsertRows (parentIndex, parent->childCount(), parent->childCount()); 1361 new AttachmentItem (parent, aDeviceType, qobject_cast <QWidget*> (QObject::parent())->isVisible());1365 new AttachmentItem (parent, aDeviceType, aVerbose); 1362 1366 endInsertRows(); 1363 1367 return index (parent->childCount() - 1, 0, parentIndex); … … 1673 1677 foreach (const CMediumAttachment &attachment, attachments) 1674 1678 { 1675 QModelIndex attIndex = mStorageModel->addAttachment (ctrId, attachment.GetType() );1679 QModelIndex attIndex = mStorageModel->addAttachment (ctrId, attachment.GetType(), false); 1676 1680 mStorageModel->setData (attIndex, QVariant::fromValue (StorageSlot (controller.GetBus(), attachment.GetPort(), attachment.GetDevice())), StorageModel::R_AttSlot); 1677 1681 CMedium medium (attachment.GetMedium()); … … 2468 2472 Assert (mStorageModel->data (index, StorageModel::R_IsMoreAttachmentsPossible).toBool()); 2469 2473 2470 mStorageModel->addAttachment (QUuid (mStorageModel->data (index, StorageModel::R_ItemId).toString()), aDevice );2474 mStorageModel->addAttachment (QUuid (mStorageModel->data (index, StorageModel::R_ItemId).toString()), aDevice, true); 2471 2475 emit storageChanged(); 2472 2476 if (mValidator) mValidator->revalidate();
Note:
See TracChangeset
for help on using the changeset viewer.