Changeset 78421 in vbox for trunk/src/VBox
- Timestamp:
- May 7, 2019 9:47:29 AM (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
r78398 r78421 366 366 fRemoved, fSilent)); 367 367 368 Q_UNUSED(comAttachment); 368 /* Parse attachment: */ 369 parseAttachment(comAttachment); 369 370 } 370 371 … … 374 375 LogRel2(("GUI: UIMediumEnumerator: OnMediumChanged event received\n")); 375 376 376 Q_UNUSED(comAttachment); 377 /* Parse attachment: */ 378 parseAttachment(comAttachment); 377 379 } 378 380 … … 382 384 LogRel2(("GUI: UIMediumEnumerator: OnMediumConfigChanged event received\n")); 383 385 384 Q_UNUSED(comMedium); 386 /* Parse medium: */ 387 parseMedium(comMedium); 385 388 } 386 389 … … 728 731 } 729 732 730 #endif /* !VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 733 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 734 735 void UIMediumEnumerator::parseAttachment(CMediumAttachment &comAttachment) 736 { 737 /* Make sure attachment is valid: */ 738 if (comAttachment.isNull()) 739 { 740 LogRel2(("GUI: UIMediumEnumerator: Attachment is NULL!\n")); 741 /// @todo is this possible case? 742 AssertFailed(); 743 } 744 else 745 { 746 /* Acquire attachment medium: */ 747 CMedium comMedium = comAttachment.GetMedium(); 748 if (!comAttachment.isOk()) 749 { 750 LogRel2(("GUI: UIMediumEnumerator: Unable to acquire attachment medium!\n")); 751 msgCenter().cannotAcquireAttachmentMedium(comAttachment); 752 } 753 else 754 { 755 /* Parse medium: */ 756 parseMedium(comMedium); 757 } 758 } 759 } 760 761 void UIMediumEnumerator::parseMedium(CMedium &comMedium) 762 { 763 /* Make sure medium is valid: */ 764 if (comMedium.isNull()) 765 { 766 LogRel2(("GUI: UIMediumEnumerator: Medium is NULL!\n")); 767 /// @todo is this possible case? 768 AssertFailed(); 769 } 770 else 771 { 772 /* Acquire medium ID: */ 773 const QUuid uMediumId = comMedium.GetId(); 774 if (!comMedium.isOk()) 775 { 776 LogRel2(("GUI: UIMediumEnumerator: Unable to acquire medium ID!\n")); 777 msgCenter().cannotAcquireMediumAttribute(comMedium); 778 } 779 else 780 { 781 //printf(" Medium to recache: %s\n", uMediumId.toString().toUtf8().constData()); 782 783 /* Make sure this medium is already cached: */ 784 if (medium(uMediumId).isNull()) 785 { 786 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} isn't cached yet!\n", 787 uMediumId.toString().toUtf8().constData())); 788 /// @todo is this valid case? 789 AssertFailed(); 790 } 791 else 792 { 793 /* Enumerate corresponding UIMedium: */ 794 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} will be enumerated..\n", 795 uMediumId.toString().toUtf8().constData())); 796 createMediumEnumerationTask(m_media.value(uMediumId)); 797 } 798 } 799 } 800 } 801 802 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 731 803 732 804 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r78397 r78421 177 177 void recacheFromActualUsage(const CMediumMap ¤tCMediums, 178 178 const QList<QUuid> ¤tCMediumIDs); 179 #endif /* !VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 179 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 180 /** Parses incoming @a comAttachment. */ 181 void parseAttachment(CMediumAttachment &comAttachment); 182 /** Parses incoming @a comMedium. */ 183 void parseMedium(CMedium &comMedium); 184 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 180 185 181 186 /** Holds whether consolidated medium-enumeration process is in progress. */
Note:
See TracChangeset
for help on using the changeset viewer.