Changeset 73917 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 27, 2018 2:35:32 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r73702 r73917 2445 2445 } 2446 2446 2447 void VBoxGlobal::refreshMediums() 2448 { 2449 /* Make sure VBoxGlobal is already valid: */ 2450 AssertReturnVoid(m_fValid); 2451 2452 /* Make sure medium-enumerator is already created: */ 2453 if (!m_pMediumEnumerator) 2454 return; 2455 2456 /* Make sure enumeration is not already started: */ 2457 if (isMediumEnumerationInProgress()) 2458 return; 2459 2460 /* Ignore the request during VBoxGlobal cleanup: */ 2461 if (s_fCleaningUp) 2462 return; 2463 2464 /* If asked to restore snapshot, don't do this till *after* we're done 2465 * restoring or the code with have a heart attack. */ 2466 if (shouldRestoreCurrentSnapshot()) 2467 return; 2468 2469 /* We assume it's safe to call it without locking, 2470 * since we are performing blocking operation here. */ 2471 m_pMediumEnumerator->refreshMediums(); 2472 } 2473 2447 2474 bool VBoxGlobal::isMediumEnumerationInProgress() const 2448 2475 { … … 3684 3711 /* Re-enumerate uimedium since they contain some translations too: */ 3685 3712 if (m_fValid) 3686 startMediumEnumeration();3713 refreshMediums(); 3687 3714 3688 3715 #ifdef VBOX_WS_X11 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r73196 r73917 478 478 /** Starts medium enumeration. */ 479 479 void startMediumEnumeration(); 480 /** Calls refresh for each medium which has been already enumerated. */ 481 void refreshMediums(); 480 482 /** Returns whether medium enumeration is in progress. */ 481 483 bool isMediumEnumerationInProgress() const; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r72667 r73917 172 172 if (!strMediumID.isNull() && strMediumID != UIMedium::nullID()) 173 173 createMediumEnumerationTask(m_mediums[strMediumID]); 174 } 175 176 void UIMediumEnumerator::refreshMediums() 177 { 178 /* Make sure we are not already in progress: */ 179 AssertReturnVoid(!m_fMediumEnumerationInProgress); 180 181 /* Refresh all known media we have: */ 182 foreach (const QString &strMediumID, m_mediums.keys()) 183 m_mediums[strMediumID].refresh(); 174 184 } 175 185 … … 579 589 580 590 #include "UIMediumEnumerator.moc" 581 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r71630 r73917 66 66 bool isMediumEnumerationInProgress() const { return m_fMediumEnumerationInProgress; } 67 67 void enumerateMediums(); 68 void refreshMediums(); 68 69 69 70 private slots: … … 105 106 106 107 #endif /* !___UIMediumEnumerator_h___ */ 107
Note:
See TracChangeset
for help on using the changeset viewer.