- Timestamp:
- May 7, 2010 2:02:57 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r29174 r29214 2068 2068 QString item; 2069 2069 2070 /* Iterate over the all machine controllers: */ 2070 2071 CStorageControllerVector controllers = aMachine.GetStorageControllers(); 2071 foreach (const CStorageController &controller, controllers) 2072 { 2073 item += QString (sSectionItemTpl3).arg (controller.GetName()); 2072 for (int i = 0; i < controllers.size(); ++i) 2073 { 2074 /* Get current controller: */ 2075 const CStorageController &controller = controllers[i]; 2076 /* Add controller information: */ 2077 item += QString(sSectionItemTpl3).arg(controller.GetName()); 2074 2078 ++ rows; 2075 2079 2076 CMediumAttachmentVector attachments = aMachine.GetMediumAttachmentsOfController (controller.GetName()); 2077 foreach (const CMediumAttachment &attachment, attachments) 2080 /* Populate sorted map with attachments information: */ 2081 QMap<StorageSlot,QString> attachmentsMap; 2082 CMediumAttachmentVector attachments = aMachine.GetMediumAttachmentsOfController(controller.GetName()); 2083 for (int j = 0; j < attachments.size(); ++j) 2078 2084 { 2079 CMedium medium = attachment.GetMedium(); 2080 if (attachment.isOk()) 2081 { 2082 /* Append 'device slot name' with 'device type name' for CD/DVD devices only */ 2083 QString strDeviceType = attachment.GetType() == KDeviceType_DVD ? tr("(CD/DVD)") : QString(); 2084 if (!strDeviceType.isNull()) strDeviceType.prepend(' '); 2085 item += QString (sSectionItemTpl2) 2086 .arg (QString (" ") + 2087 toString (StorageSlot (controller.GetBus(), 2088 attachment.GetPort(), 2089 attachment.GetDevice())) + 2090 strDeviceType) 2091 .arg (details (medium, false)); 2092 ++ rows; 2093 } 2085 /* Get current attachment: */ 2086 const CMediumAttachment &attachment = attachments[j]; 2087 /* Prepare current storage slot: */ 2088 StorageSlot attachmentSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()); 2089 /* Append 'device slot name' with 'device type name' for CD/DVD devices only: */ 2090 QString strDeviceType = attachment.GetType() == KDeviceType_DVD ? tr("(CD/DVD)") : QString(); 2091 if (!strDeviceType.isNull()) 2092 strDeviceType.prepend(' '); 2093 /* Prepare current medium object: */ 2094 const CMedium &medium = attachment.GetMedium(); 2095 /* Prepare information about current medium & attachment: */ 2096 QString strAttachmentInfo = !attachment.isOk() ? QString() : 2097 QString(sSectionItemTpl2) 2098 .arg(QString(" ") + 2099 toString(StorageSlot(controller.GetBus(), 2100 attachment.GetPort(), 2101 attachment.GetDevice())) + strDeviceType) 2102 .arg(details(medium, false)); 2103 /* Insert that attachment into map: */ 2104 if (!strAttachmentInfo.isNull()) 2105 attachmentsMap.insert(attachmentSlot, strAttachmentInfo); 2106 } 2107 2108 /* Iterate over the sorted map with attachments information: */ 2109 QMapIterator<StorageSlot,QString> it(attachmentsMap); 2110 while (it.hasNext()) 2111 { 2112 /* Add controller information: */ 2113 it.next(); 2114 item += it.value(); 2115 ++rows; 2094 2116 } 2095 2117 }
Note:
See TracChangeset
for help on using the changeset viewer.