Changeset 78397 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 6, 2019 5:32:54 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
r78299 r78397 93 93 94 94 /* Prepare Main event handlers: */ 95 #ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS 95 96 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange, 96 97 this, &UIMediumEnumerator::sltHandleMachineUpdate); … … 105 106 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered, 106 107 this, &UIMediumEnumerator::sltHandleMachineRegistration); 108 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 109 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigStorageControllerChange, 110 this, &UIMediumEnumerator::sltHandleStorageControllerChange); 111 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigStorageDeviceChange, 112 this, &UIMediumEnumerator::sltHandleStorageDeviceChange); 113 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMediumChange, 114 this, &UIMediumEnumerator::sltHandleMediumChange); 115 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMediumConfigChange, 116 this, &UIMediumEnumerator::sltHandleMediumConfigChange); 117 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMediumRegistered, 118 this, &UIMediumEnumerator::sltHandleMediumRegistered); 119 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 107 120 108 121 /* Prepare global thread-pool listener: */ … … 234 247 } 235 248 249 #ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS 250 236 251 void UIMediumEnumerator::sltHandleMachineUpdate(const QUuid &uMachineID) 237 252 { … … 333 348 } 334 349 350 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 351 352 void UIMediumEnumerator::sltHandleStorageControllerChange(const QUuid &uMachineId, const QString &strControllerName) 353 { 354 //printf("OnStorageControllerChanged: machine-id=%s, controller-name=%s\n", 355 // uMachineId.toString().toUtf8().constData(), strControllerName.toUtf8().constData()); 356 LogRel2(("GUI: UIMediumEnumerator: OnStorageControllerChanged event received, Medium ID = {%s}, Controller Name = {%s}\n", 357 uMachineId.toString().toUtf8().constData(), strControllerName.toUtf8().constData())); 358 } 359 360 void UIMediumEnumerator::sltHandleStorageDeviceChange(CMediumAttachment comAttachment, bool fRemoved, bool fSilent) 361 { 362 //printf("OnStorageDeviceChanged: removed=%d, silent=%d\n", 363 // fRemoved, fSilent); 364 LogRel2(("GUI: UIMediumEnumerator: OnStorageDeviceChanged event received, Removed = {%d}, Silent = {%d}\n", 365 fRemoved, fSilent)); 366 367 Q_UNUSED(comAttachment); 368 } 369 370 void UIMediumEnumerator::sltHandleMediumChange(CMediumAttachment comAttachment) 371 { 372 //printf("OnMediumChanged\n"); 373 LogRel2(("GUI: UIMediumEnumerator: OnMediumChanged event received\n")); 374 375 Q_UNUSED(comAttachment); 376 } 377 378 void UIMediumEnumerator::sltHandleMediumConfigChange(CMedium comMedium) 379 { 380 //printf("OnMediumConfigChanged\n"); 381 LogRel2(("GUI: UIMediumEnumerator: OnMediumConfigChanged event received\n")); 382 383 Q_UNUSED(comMedium); 384 } 385 386 void UIMediumEnumerator::sltHandleMediumRegistered(const QUuid &uMediumId, KDeviceType enmMediumType, bool fRegistered) 387 { 388 //printf("OnMediumRegistered: medium-id=%s, medium-type=%d, registered=%d\n", 389 // uMediumId.toString().toUtf8().constData(), enmMediumType, fRegistered); 390 //printf(" Medium to recache: %s\n", 391 // uMediumId.toString().toUtf8().constData()); 392 LogRel2(("GUI: UIMediumEnumerator: OnMediumRegistered event received, Medium ID = {%s}, Medium type = {%d}, Registered = {%d}\n", 393 uMediumId.toString().toUtf8().constData(), enmMediumType, fRegistered)); 394 } 395 396 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 397 335 398 void UIMediumEnumerator::sltHandleMediumEnumerationTaskComplete(UITask *pTask) 336 399 { … … 449 512 } 450 513 } 514 515 #ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS 451 516 452 517 void UIMediumEnumerator::calculateCachedUsage(const QUuid &uMachineID, … … 596 661 } 597 662 663 #endif /* !VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 664 598 665 599 666 #include "UIMediumEnumerator.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r78299 r78397 22 22 #endif 23 23 24 //#define VBOX_GUI_WITH_NEW_MEDIA_EVENTS 25 24 26 /* Qt includes: */ 25 27 #include <QObject> … … 30 32 #include "UILibraryDefs.h" 31 33 #include "UIMedium.h" 34 35 /* COM includes: */ 36 #ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS 37 # include "CMedium.h" 38 # include "CMediumAttachment.h" 39 #endif 32 40 33 41 /* Forward declarations: */ … … 92 100 private slots: 93 101 102 #ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS 94 103 /** Handles machine-data-change and snapshot-change events for a machine with specified @a uMachineID. */ 95 104 void sltHandleMachineUpdate(const QUuid &uMachineID); … … 99 108 /** Handles snapshot-deleted events for a machine with specified @a uMachineID and a snapshot with specified @a uSnapshotID. */ 100 109 void sltHandleSnapshotDeleted(const QUuid &uMachineID, const QUuid &uSnapshotID); 110 #else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 111 /** Handles signal about storage controller change. 112 * @param uMachineId Brings the ID of machine corresponding controller belongs to. 113 * @param strControllerName Brings the name of controller this event is related to. */ 114 void sltHandleStorageControllerChange(const QUuid &uMachineId, const QString &strControllerName); 115 /** Handles signal about storage device change. 116 * @param comAttachment Brings corresponding attachment. 117 * @param fRemoved Brings whether medium is removed or added. 118 * @param fSilent Brings whether this change has gone silent for guest. */ 119 void sltHandleStorageDeviceChange(CMediumAttachment comAttachment, bool fRemoved, bool fSilent); 120 /** Handles signal about storage medium @a comAttachment state change. */ 121 void sltHandleMediumChange(CMediumAttachment comAttachment); 122 /** Handles signal about storage @a comMedium config change. */ 123 void sltHandleMediumConfigChange(CMedium comMedium); 124 /** Handles signal about storage medium is (un)registered. 125 * @param uMediumId Brings corresponding medium ID. 126 * @param enmMediumType Brings corresponding medium type. 127 * @param fRegistered Brings whether medium is registered or unregistered. */ 128 void sltHandleMediumRegistered(const QUuid &uMediumId, KDeviceType enmMediumType, bool fRegistered); 129 #endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 101 130 102 131 /** Handles medium-enumeration @a pTask complete signal. */ … … 112 141 void addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia); 113 142 143 #ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS 114 144 /** Updates usage for machine with specified @a uMachineID on the basis of cached data. 115 145 * @param previousUIMediumIDs Brings UIMedium IDs used in cached data. … … 147 177 void recacheFromActualUsage(const CMediumMap ¤tCMediums, 148 178 const QList<QUuid> ¤tCMediumIDs); 179 #endif /* !VBOX_GUI_WITH_NEW_MEDIA_EVENTS */ 149 180 150 181 /** Holds whether consolidated medium-enumeration process is in progress. */
Note:
See TracChangeset
for help on using the changeset viewer.