VirtualBox

Ignore:
Timestamp:
Jun 13, 2019 12:38:40 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131291
Message:

FE/Qt: bugref:7127: A bit of refactoring: More flexible input/output arguments for UIMediumEnumerator parse routines.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp

    r79044 r79127  
    392392
    393393    /* Parse attachment: */
    394     parseAttachment(comAttachment);
     394    QList<QUuid> result;
     395    parseAttachment(comAttachment, result);
    395396}
    396397
     
    401402
    402403    /* Parse attachment: */
    403     parseAttachment(comAttachment);
     404    QList<QUuid> result;
     405    parseAttachment(comAttachment, result);
    404406}
    405407
     
    410412
    411413    /* Parse medium: */
    412     parseMedium(comMedium);
     414    QList<QUuid> result;
     415    parseMedium(comMedium, result);
    413416}
    414417
     
    757760#else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
    758761
    759 QList<QUuid> UIMediumEnumerator::parseAttachment(CMediumAttachment &comAttachment)
    760 {
    761     /* Prepare result: */
    762     QList<QUuid> result;
    763 
     762void UIMediumEnumerator::parseAttachment(CMediumAttachment comAttachment, QList<QUuid> &result)
     763{
    764764    /* Make sure attachment is valid: */
    765765    if (comAttachment.isNull())
     
    781781        {
    782782            /* Parse medium: */
    783             result << parseMedium(comMedium);
     783            parseMedium(comMedium, result);
    784784
    785785            // WORKAROUND:
     
    825825        }
    826826    }
    827 
    828     /* Return result: */
    829     return result;
    830 }
    831 
    832 QList<QUuid> UIMediumEnumerator::parseMedium(CMedium &comMedium)
    833 {
    834     /* Prepare result: */
    835     QList<QUuid> result;
    836 
     827}
     828
     829void UIMediumEnumerator::parseMedium(CMedium comMedium, QList<QUuid> &result)
     830{
    837831    /* Make sure medium is valid: */
    838832    if (comMedium.isNull())
     
    874868        }
    875869    }
    876 
    877     /* Return result: */
    878     return result;
    879870}
    880871
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h

    r79043 r79127  
    183183                                const QList<QUuid> &currentCMediumIDs);
    184184#else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
    185     /** Parses incoming @a comAttachment.
    186       * @returns a list of newly enumerated media IDs. */
    187     QList<QUuid> parseAttachment(CMediumAttachment &comAttachment);
    188     /** Parses incoming @a comMedium.
    189       * @returns a list of newly enumerated media IDs. */
    190     QList<QUuid> parseMedium(CMedium &comMedium);
     185    /** Parses incoming @a comAttachment, enumerating the media it has attached.
     186      * @param  result  Brings the list of previously enumerated media
     187      *                 IDs to be appended with newly enumerated. */
     188    void parseAttachment(CMediumAttachment comAttachment, QList<QUuid> &result);
     189    /** Parses incoming @a comMedium, enumerating the media it represents.
     190      * @param  result  Brings the list of previously enumerated media
     191      *                 IDs to be appended with newly enumerated. */
     192    void parseMedium(CMedium comMedium, QList<QUuid> &result);
    191193#endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
    192194
Note: See TracChangeset for help on using the changeset viewer.

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