Changeset 48272 in vbox
- Timestamp:
- Sep 4, 2013 4:15:12 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/medium
- Files:
-
- 2 edited
-
UIMedium.cpp (modified) (5 diffs)
-
UIMedium.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
r48089 r48272 69 69 m_fHostDrive = other.isHostDrive(); 70 70 71 m_machineIds = other.machineIds(); 71 72 m_curStateMachineIds = other.curStateMachineIds(); 72 73 … … 218 219 { 219 220 m_curStateMachineIds.clear(); 220 QVector <QString> machineIds = m_medium.GetMachineIds();221 if (m achineIds.size() > 0)221 m_machineIds = m_medium.GetMachineIds().toList(); 222 if (m_machineIds.size() > 0) 222 223 { 223 224 /* We assume this flag is 'true' if at least one machine present: */ … … 228 229 CVirtualBox vbox = vboxGlobal().virtualBox(); 229 230 230 for (QVector <QString>::ConstIterator it = machineIds.begin(); it != machineIds.end(); ++it)231 foreach (const QString &strMachineID, m_machineIds) 231 232 { 232 CMachine machine = vbox.FindMachine( *it);233 CMachine machine = vbox.FindMachine(strMachineID); 233 234 234 235 /* UIMedium object can wrap newly created CMedium object which belongs to … … 251 252 QString strSnapshots; 252 253 253 QVector <QString> snapIds = m_medium.GetSnapshotIds( *it);254 QVector <QString> snapIds = m_medium.GetSnapshotIds(strMachineID); 254 255 for (QVector <QString>::ConstIterator jt = snapIds.begin(); jt != snapIds.end(); ++jt) 255 256 { 256 if (*jt == *it)257 if (*jt == strMachineID) 257 258 { 258 259 /* The medium is attached to the machine in the current … … 515 516 } 516 517 518 /* static */ 519 QString UIMedium::nullID() 520 { 521 return QUuid().toString().remove('{').remove('}'); 522 } 523 517 524 /** 518 525 * Checks if m_noDiffs is filled in and does it if not. -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h
r48089 r48272 21 21 22 22 /* Qt includes: */ 23 #include <QMap> 24 #include <QLinkedList> 23 25 #include <QPixmap> 24 #include <QLinkedList>25 26 26 27 /* GUI includes: */ … … 200 201 201 202 /** 203 * Returns a vector of IDs of all machines this medium is attached to. 204 */ 205 const QList <QString> &machineIds() const { return m_machineIds; } 206 207 /** 202 208 * Returns @c true if this medium is attached to the given machine in the current state. 203 209 */ … … 233 239 /** Returns @c true if this media descriptor is a null object. */ 234 240 bool isNull() const { return m_medium.isNull(); } 241 242 /* Static API: Null medium ID: */ 243 static QString nullID(); 235 244 236 245 private: … … 267 276 bool m_fHostDrive : 1; 268 277 278 QList<QString> m_machineIds; 269 279 QList<QString> m_curStateMachineIds; 270 280 … … 276 286 static QString m_sstrRow; 277 287 }; 288 Q_DECLARE_METATYPE(UIMedium); 278 289 279 290 typedef QLinkedList<UIMedium> VBoxMediaList; 291 typedef QMap<QString, UIMedium> UIMediumMap; 280 292 281 293 #endif /* __UIMedium_h__ */
Note:
See TracChangeset
for help on using the changeset viewer.

