- Timestamp:
- Mar 20, 2020 4:01:35 PM (5 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
r83205 r83353 314 314 if (!medium(uMediumId).isNull()) 315 315 { 316 /* This medium can be known because of async event nature. Currently medium registration event 317 * comes very late and other even unrealted events can come before it and request for this 318 * particular medium enumeration, so we just ignore that and enumerate this UIMedium again. */ 319 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} is cached already and will be enumerated..\n", 320 uMediumId.toString().toUtf8().constData())); 321 createMediumEnumerationTask(m_media.value(uMediumId)); 316 /* This medium can be known because of async event nature. Currently medium registration event comes 317 * very late and other even unrelated events can come before it and request for this particular medium 318 * enumeration, so we just ignore repetitive events but enumerate this UIMedium at least once if it 319 * wasn't registered before. */ 320 if (!m_registeredMediaIds.contains(uMediumId)) 321 { 322 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} is cached but not registered already, so will be enumerated..\n", 323 uMediumId.toString().toUtf8().constData())); 324 createMediumEnumerationTask(m_media.value(uMediumId)); 325 326 /* Mark medium registered: */ 327 m_registeredMediaIds << uMediumId; 328 } 322 329 } 323 330 else … … 347 354 /* Enumerate corresponding UIMedium: */ 348 355 createMediumEnumerationTask(m_media.value(uMediumId)); 356 357 /* Mark medium registered: */ 358 m_registeredMediaIds << uMediumId; 349 359 } 350 360 } … … 379 389 enumerateAllMediaOfMediumWithId(uMediumId, result); 380 390 } 391 392 /* Mark medium unregistered: */ 393 m_registeredMediaIds.remove(uMediumId); 381 394 } 382 395 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r82968 r83353 161 161 QSet<UITask*> m_tasks; 162 162 163 /** Holds a map of current cached (enumerated) media. */163 /** Holds a map of currently cached (enumerated) media. */ 164 164 UIMediumMap m_media; 165 /** Holds a set of currently registered media IDs. */ 166 QSet<QUuid> m_registeredMediaIds; 165 167 }; 166 168
Note:
See TracChangeset
for help on using the changeset viewer.