VirtualBox

Changeset 80890 in vbox for trunk


Ignore:
Timestamp:
Sep 18, 2019 1:46:52 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8472: A bit of cleanup for machine media enumeration code.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r80888 r80890  
    483483     * @{ */
    484484        /** Starts medium-enumeration. */
    485         void startMediumEnumeration(const CMediumVector &mediaList = CMediumVector());
     485        void startMediumEnumeration(const CMediumVector &comMedia = CMediumVector());
    486486        /** Enumerates additional medium. */
    487487        void enumerateAdditionalMedium(const CMedium &comMedium);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r80652 r80890  
    210210    {
    211211        AssertReturn(m_pSession, false);
    212         uiCommon().startMediumEnumeration(m_pSession->getMachineMedia());
    213     }
     212        uiCommon().startMediumEnumeration(m_pSession->machineMedia());
     213    }
     214
    214215    /* Prepare machine-logic: */
    215216    prepareMachineLogic();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r80576 r80890  
    21732173}
    21742174
    2175 CMediumVector UISession::getMachineMedia() const
    2176 {
    2177     CMediumVector media;
     2175CMediumVector UISession::machineMedia() const
     2176{
     2177    CMediumVector comMedia;
     2178    /* Enumerate all the controllers: */
    21782179    foreach (const CStorageController &comController, m_machine.GetStorageControllers())
    21792180    {
    2180         QString strAttData;
    21812181        /* Enumerate all the attachments: */
    21822182        foreach (const CMediumAttachment &comAttachment, m_machine.GetMediumAttachmentsOfController(comController.GetName()))
    21832183        {
    2184             /* Skip unrelated attachments: */
    2185             if (comAttachment.GetType() != KDeviceType_HardDisk &&
    2186                 comAttachment.GetType() != KDeviceType_Floppy &&
    2187                 comAttachment.GetType() != KDeviceType_DVD)
     2184            /* Skip unrelated device types: */
     2185            const KDeviceType enmDeviceType = comAttachment.GetType();
     2186            if (   enmDeviceType != KDeviceType_HardDisk
     2187                && enmDeviceType != KDeviceType_Floppy
     2188                && enmDeviceType != KDeviceType_DVD)
    21882189                continue;
    2189             if (comAttachment.GetIsEjected() || comAttachment.GetMedium().isNull())
     2190            if (   comAttachment.GetIsEjected()
     2191                || comAttachment.GetMedium().isNull())
    21902192                continue;
    2191             media.append(comAttachment.GetMedium());
    2192         }
    2193     }
    2194     return media;
     2193            comMedia.append(comAttachment.GetMedium());
     2194        }
     2195    }
     2196    return comMedia;
    21952197}
    21962198
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r80543 r80890  
    298298
    299299    /** Returns a vector of media attached to the machine. */
    300     CMediumVector getMachineMedia() const;
     300    CMediumVector machineMedia() const;
    301301
    302302signals:
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