Changeset 79150 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 14, 2019 1:12:21 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
r79131 r79150 387 387 uMachineId.toString().toUtf8().constData())); 388 388 389 /* Parse machineID: */389 /* Enumerate all the media of machine with this ID: */ 390 390 QList<QUuid> result; 391 parseMachineId(uMachineId, result);391 enumerateAllMediaOfMachineWithId(uMachineId, result); 392 392 } 393 393 … … 414 414 void UIMediumEnumerator::sltHandleMediumChange(CMediumAttachment comAttachment) 415 415 { 416 //printf(" OnMediumChanged\n");417 LogRel2(("GUI: UIMediumEnumerator: OnMediumChanged event received\n"));416 //printf("MediumChanged\n"); 417 LogRel2(("GUI: UIMediumEnumerator: MediumChanged event received\n")); 418 418 419 419 /* Parse attachment: */ … … 424 424 void UIMediumEnumerator::sltHandleMediumConfigChange(CMedium comMedium) 425 425 { 426 //printf(" OnMediumConfigChanged\n");427 LogRel2(("GUI: UIMediumEnumerator: OnMediumConfigChanged event received\n"));426 //printf("MediumConfigChanged\n"); 427 LogRel2(("GUI: UIMediumEnumerator: MediumConfigChanged event received\n")); 428 428 429 429 /* Parse medium: */ … … 434 434 void UIMediumEnumerator::sltHandleMediumRegistered(const QUuid &uMediumId, KDeviceType enmMediumType, bool fRegistered) 435 435 { 436 //printf(" OnMediumRegistered: medium-id=%s, medium-type=%d, registered=%d\n",436 //printf("MediumRegistered: medium-id=%s, medium-type=%d, registered=%d\n", 437 437 // uMediumId.toString().toUtf8().constData(), enmMediumType, fRegistered); 438 438 //printf(" Medium to recache: %s\n", 439 439 // uMediumId.toString().toUtf8().constData()); 440 LogRel2(("GUI: UIMediumEnumerator: OnMediumRegistered event received, Medium ID = {%s}, Medium type = {%d}, Registered = {%d}\n",440 LogRel2(("GUI: UIMediumEnumerator: MediumRegistered event received, Medium ID = {%s}, Medium type = {%d}, Registered = {%d}\n", 441 441 uMediumId.toString().toUtf8().constData(), enmMediumType, fRegistered)); 442 442 … … 775 775 776 776 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 777 778 void UIMediumEnumerator::parseMachineId(const QUuid &uMachineId, QList<QUuid> &result)779 {780 /* For each the cached UIMedium we have: */781 foreach (const QUuid &uMediumId, mediumIDs())782 {783 /* Check if medium isn't NULL, used by our784 * machine and wasn't already enumerated. */785 const UIMedium guiMedium = medium(uMediumId);786 if ( !guiMedium.isNull()787 && guiMedium.machineIds().contains(uMachineId)788 && !result.contains(uMediumId))789 {790 /* Enumerate corresponding UIMedium: */791 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} of machine {%s} will be enumerated..\n",792 uMediumId.toString().toUtf8().constData(),793 uMachineId.toString().toUtf8().constData()));794 createMediumEnumerationTask(guiMedium);795 result << uMediumId;796 }797 }798 }799 777 800 778 void UIMediumEnumerator::parseAttachment(CMediumAttachment comAttachment, QList<QUuid> &result) … … 844 822 else 845 823 { 846 /* Parse machineID: */847 parseMachineId(uMachineId, result);824 /* Enumerate all the media of machine with this ID: */ 825 enumerateAllMediaOfMachineWithId(uMachineId, result); 848 826 } 849 827 } … … 895 873 } 896 874 875 void UIMediumEnumerator::enumerateAllMediaOfMachineWithId(const QUuid &uMachineId, QList<QUuid> &result) 876 { 877 /* For each the cached UIMedium we have: */ 878 foreach (const QUuid &uMediumId, mediumIDs()) 879 { 880 /* Check if medium isn't NULL, used by our 881 * machine and wasn't already enumerated. */ 882 const UIMedium guiMedium = medium(uMediumId); 883 if ( !guiMedium.isNull() 884 && guiMedium.machineIds().contains(uMachineId) 885 && !result.contains(uMediumId)) 886 { 887 /* Enumerate corresponding UIMedium: */ 888 printf(" Medium to recache: %s\n", 889 uMediumId.toString().toUtf8().constData()); 890 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} of machine {%s} will be enumerated..\n", 891 uMediumId.toString().toUtf8().constData(), 892 uMachineId.toString().toUtf8().constData())); 893 createMediumEnumerationTask(guiMedium); 894 result << uMediumId; 895 } 896 } 897 } 898 897 899 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 898 900 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r79131 r79150 186 186 const QList<QUuid> ¤tCMediumIDs); 187 187 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 188 /** Parses machine with incoming @a uMachineId, enumerating ONLY KNOWN media it has.189 * @param result Brings the list of previously enumerated media190 * IDs to be appended with newly enumerated. */191 void parseMachineId(const QUuid &uMachineId, QList<QUuid> &result);192 188 /** Parses incoming @a comAttachment, enumerating the media it has attached. 193 189 * @param result Brings the list of previously enumerated media … … 198 194 * IDs to be appended with newly enumerated. */ 199 195 void parseMedium(CMedium comMedium, QList<QUuid> &result); 196 197 /** Enumerates all the known media attached to machine with certain @a uMachineId. 198 * @param result Brings the list of previously enumerated media 199 * IDs to be appended with newly enumerated. */ 200 void enumerateAllMediaOfMachineWithId(const QUuid &uMachineId, QList<QUuid> &result); 200 201 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 201 202
Note:
See TracChangeset
for help on using the changeset viewer.