VirtualBox

Changeset 79205 in vbox


Ignore:
Timestamp:
Jun 18, 2019 10:04:17 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7127: Enumerate media only if full medium enumeration wasn't performed before, otherwise we are listening for events.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r79191 r79205  
    25742574}
    25752575
     2576#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     2577bool VBoxGlobal::isFullMediumEnumerationRequested() const
     2578{
     2579    /* Redirect request to medium-enumerator: */
     2580    return    m_pMediumEnumerator
     2581           && m_pMediumEnumerator->isFullMediumEnumerationRequested();
     2582}
     2583#endif
     2584
    25762585UIMedium VBoxGlobal::medium(const QUuid &uMediumID) const
    25772586{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r78723 r79205  
    484484        /** Returns whether medium-enumeration is in progress. */
    485485        bool isMediumEnumerationInProgress() const;
     486#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     487        /** Returns whether full medium-enumeration is requested. */
     488        bool isFullMediumEnumerationRequested() const;
     489#endif
    486490        /** Returns enumerated medium with certain @a uMediumID. */
    487491        UIMedium medium(const QUuid &uMediumID) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp

    r79152 r79205  
    8989UIMediumEnumerator::UIMediumEnumerator()
    9090    : m_fMediumEnumerationInProgress(false)
     91#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     92    , m_fMediumEnumerationRequested(false)
     93#endif
    9194{
    9295    /* Allow UIMedium to be used in inter-thread signals: */
     
    195198    if (comMedia.isEmpty())
    196199    {
     200#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     201        m_fMediumEnumerationRequested = true;
     202#endif
    197203        addMediaToMap(vboxGlobal().virtualBox().GetHardDisks(), media);
    198204        addMediaToMap(vboxGlobal().host().GetDVDDrives(), media);
     
    203209    else
    204210    {
     211#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     212        m_fMediumEnumerationRequested = false;
     213#endif
    205214        addMediaToMap(vboxGlobal().host().GetDVDDrives(), media);
    206215        addMediaToMap(vboxGlobal().virtualBox().GetDVDImages(), media);
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h

    r79152 r79205  
    8282    /** Returns whether consolidated medium-enumeration process is in progress. */
    8383    bool isMediumEnumerationInProgress() const { return m_fMediumEnumerationInProgress; }
     84#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     85    /** Returns whether full consolidated medium-enumeration process is requested. */
     86    bool isFullMediumEnumerationRequested() const { return m_fMediumEnumerationRequested; }
     87#endif
    8488    /** Makes a request to enumerate specified @a comMedia.
    8589      * @note  Previous map will be replaced with the new one, values present in both
     
    207211    /** Holds whether consolidated medium-enumeration process is in progress. */
    208212    bool  m_fMediumEnumerationInProgress;
     213#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     214    /** Holds whether full consolidated medium-enumeration process is requested. */
     215    bool  m_fMediumEnumerationRequested;
     216#endif
    209217
    210218    /** Holds a set of current medium-enumeration tasks. */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r79204 r79205  
    695695
    696696    /* Start medium-enumeration (if necessary): */
     697#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
    697698    if (!vboxGlobal().isMediumEnumerationInProgress())
     699#else
     700    if (!vboxGlobal().isFullMediumEnumerationRequested())
     701#endif
    698702        vboxGlobal().startMediumEnumeration();
    699703    /* Emulate medium-enumeration otherwise: */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp

    r78722 r79205  
    8080    , m_strMachineGuestOSTypeId(strMachineGuestOSTypeId)
    8181{
     82    /* Start medium-enumeration (if necessary): */
     83#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
    8284    if (vboxGlobal().uiType() == VBoxGlobal::UIType_RuntimeUI)
     85#else
     86    if (!vboxGlobal().isFullMediumEnumerationRequested())
     87#endif
    8388        vboxGlobal().startMediumEnumeration();
    8489    configure();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r78722 r79205  
    167167    loadSettings();
    168168
    169     /* This is needed at least for some vm to show correct storage info. For the manager UI enumeration has been done already: */
     169    /* This is needed at least for some VM to show correct storage info. */
     170#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
    170171    if (vboxGlobal().uiType() == VBoxGlobal::UIType_RuntimeUI)
     172#else
     173    if (!vboxGlobal().isFullMediumEnumerationRequested())
     174#endif
    171175        vboxGlobal().startMediumEnumeration();
    172176}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r78722 r79205  
    37083708    UIIconPoolStorageSettings::create();
    37093709
     3710#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     3711    /* Start medium-enumeration (only if necessary): */
     3712    if (!vboxGlobal().isFullMediumEnumerationRequested())
     3713#endif
    37103714    /* Enumerate Media. We need at least the MediaList filled, so this is the
    37113715     * lasted point, where we can start. The rest of the media checking is done
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.cpp

    r78722 r79205  
    5858void UIMediaComboBox::repopulate()
    5959{
     60    /* Start medium-enumeration (if necessary): */
     61#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
    6062    if (!vboxGlobal().isMediumEnumerationInProgress())
     63#else
     64    if (!vboxGlobal().isFullMediumEnumerationRequested())
     65#endif
    6166        vboxGlobal().startMediumEnumeration();
    6267    else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette