VirtualBox

Changeset 73938 in vbox for trunk


Ignore:
Timestamp:
Aug 29, 2018 7:31:32 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8472. Change media enumeration function so that it accepts a CMediumVector to start enumeration with

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

Legend:

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

    r73926 r73938  
    24142414}
    24152415
    2416 void VBoxGlobal::startMediumEnumeration()
     2416void VBoxGlobal::startMediumEnumeration(const CMediumVector &mediaList /* = CMediumVector() */)
    24172417{
    24182418    /* Make sure VBoxGlobal is already valid: */
     
    24402440        /* Redirect request to medium-enumerator: */
    24412441        if (m_pMediumEnumerator)
    2442             m_pMediumEnumerator->enumerateMedia();
     2442            m_pMediumEnumerator->enumerateMedia(mediaList);
    24432443        m_meCleanupProtectionToken.unlock();
    24442444    }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r73926 r73938  
    3434/* COM includes: */
    3535#include "VBox/com/Guid.h"
     36#include "CGuestOSType.h"
    3637#include "CHost.h"
     38#include "CMedium.h"
     39#include "CSession.h"
    3740#include "CVirtualBoxClient.h"
    3841#include "CVirtualBox.h"
    39 #include "CSession.h"
    40 #include "CGuestOSType.h"
    4142
    4243/* Other includes: */
     
    5354class CHostVideoInputDevice;
    5455class CMachine;
    55 class CMedium;
    5656class CUSBDevice;
    5757class UIMedium;
     
    477477     * @{ */
    478478        /** Starts medium enumeration. */
    479         void startMediumEnumeration();
     479        void startMediumEnumeration(const CMediumVector &mediaList = CMediumVector());
    480480        /** Calls refresh for each medium which has been already enumerated. */
    481481        void refreshMedia();
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp

    r73931 r73938  
    136136}
    137137
    138 void UIMediumEnumerator::enumerateMedia()
     138void UIMediumEnumerator::enumerateMedia(const CMediumVector &mediaList /* = CMediumVector() */)
    139139{
    140140    /* Make sure we are not already in progress: */
     
    145145    UIMediumMap media;
    146146    addNullMediumToMap(media);
    147     addMediaToMap(vboxGlobal().virtualBox().GetHardDisks(), media);
    148     addMediaToMap(vboxGlobal().host().GetDVDDrives(), media);
    149     addMediaToMap(vboxGlobal().virtualBox().GetDVDImages(), media);
    150     addMediaToMap(vboxGlobal().host().GetFloppyDrives(), media);
    151     addMediaToMap(vboxGlobal().virtualBox().GetFloppyImages(), media);
     147    /* If @p mediaList is empty we start the media enumeration with all known media: */
     148    if (mediaList.isEmpty())
     149    {
     150        addMediaToMap(vboxGlobal().virtualBox().GetHardDisks(), media);
     151        addMediaToMap(vboxGlobal().host().GetDVDDrives(), media);
     152        addMediaToMap(vboxGlobal().virtualBox().GetDVDImages(), media);
     153        addMediaToMap(vboxGlobal().host().GetFloppyDrives(), media);
     154        addMediaToMap(vboxGlobal().virtualBox().GetFloppyImages(), media);
     155    }
     156    else
     157        addMediaToMap(mediaList, media);
    152158    if (VBoxGlobal::isCleaningUp())
    153159        return; /* VBoxGlobal is cleaning up, abort immediately. */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h

    r73931 r73938  
    6565    /* API: Medium-enumeration stuff: */
    6666    bool isMediumEnumerationInProgress() const { return m_fMediumEnumerationInProgress; }
    67     void enumerateMedia();
     67    void enumerateMedia(const CMediumVector &mediaList = CMediumVector());
    6868    void refreshMedia();
    6969
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