Changeset 79128 in vbox
- Timestamp:
- Jun 13, 2019 12:46:16 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
r79127 r79128 760 760 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 761 761 762 void UIMediumEnumerator::parseMachine(CMachine comMachine, QList<QUuid> &result) 763 { 764 /* Acquire machine ID: */ 765 const QUuid uMachineId = comMachine.GetId(); 766 if (!comMachine.isOk()) 767 { 768 LogRel2(("GUI: UIMediumEnumerator: Unable to acquire machine ID!\n")); 769 msgCenter().cannotAcquireMachineParameter(comMachine); 770 } 771 else 772 { 773 /* For each the cached UIMedium we have: */ 774 foreach (const QUuid &uMediumId, mediumIDs()) 775 { 776 /* Check if medium isn't NULL, used by our 777 * machine and wasn't already enumerated. */ 778 const UIMedium guiMedium = medium(uMediumId); 779 if ( !guiMedium.isNull() 780 && guiMedium.machineIds().contains(uMachineId) 781 && !result.contains(uMediumId)) 782 { 783 /* Enumerate corresponding UIMedium: */ 784 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} of machine {%s} will be enumerated..\n", 785 uMediumId.toString().toUtf8().constData(), 786 uMachineId.toString().toUtf8().constData())); 787 createMediumEnumerationTask(guiMedium); 788 result << uMediumId; 789 } 790 } 791 } 792 } 793 762 794 void UIMediumEnumerator::parseAttachment(CMediumAttachment comAttachment, QList<QUuid> &result) 763 795 { … … 797 829 else 798 830 { 799 /* Acquire machine ID: */ 800 const QUuid uMachineId = comMachine.GetId(); 801 if (!comMachine.isOk()) 802 { 803 LogRel2(("GUI: UIMediumEnumerator: Unable to acquire machine ID!\n")); 804 msgCenter().cannotAcquireMachineParameter(comMachine); 805 } 806 else 807 { 808 /* For each the cached UIMedium we have: */ 809 foreach (const QUuid &uMediumId, mediumIDs()) 810 { 811 const UIMedium guiMedium = medium(uMediumId); 812 if ( !guiMedium.isNull() 813 && guiMedium.machineIds().contains(uMachineId) 814 && !result.contains(uMediumId)) 815 { 816 /* Enumerate corresponding UIMedium: */ 817 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} will be enumerated..\n", 818 uMediumId.toString().toUtf8().constData())); 819 createMediumEnumerationTask(guiMedium); 820 result << uMediumId; 821 } 822 } 823 } 831 /* Parse machine: */ 832 parseMachine(comMachine, result); 824 833 } 825 834 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r79127 r79128 183 183 const QList<QUuid> ¤tCMediumIDs); 184 184 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 185 /** Parses incoming @a comMachine, enumerating ONLY KNOWN media it has. 186 * @param result Brings the list of previously enumerated media 187 * IDs to be appended with newly enumerated. */ 188 void parseMachine(CMachine comMachine, QList<QUuid> &result); 185 189 /** Parses incoming @a comAttachment, enumerating the media it has attached. 186 190 * @param result Brings the list of previously enumerated media
Note:
See TracChangeset
for help on using the changeset viewer.