VirtualBox

Changeset 43542 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Oct 4, 2012 1:28:09 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81145
Message:

FE/Qt: VM group feature UI: Current-item handling cleanup (part 4).

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r43540 r43542  
    188188UIVMItem* UIGChooserModel::currentMachineItem() const
    189189{
    190     /* Search for the first selected machine: */
    191     return searchCurrentItem(currentItems());
     190    /* Return first machine-item: */
     191    return firstMachineItem(currentItems());
    192192}
    193193
     
    13151315}
    13161316
    1317 UIVMItem* UIGChooserModel::searchCurrentItem(const QList<UIGChooserItem*> &list) const
     1317UIGChooserItemMachine* UIGChooserModel::firstMachineItem(const QList<UIGChooserItem*> &list) const
    13181318{
    13191319    /* Iterate over all the passed items: */
    13201320    foreach (UIGChooserItem *pItem, list)
    13211321    {
    1322         /* If item is machine, just return it: */
     1322        /* If that is machine-item, just return it: */
    13231323        if (pItem->type() == UIGChooserItemType_Machine)
    13241324        {
     
    13261326                return pMachineItem;
    13271327        }
    1328         /* If item is group: */
     1328        /* If that is group-item: */
    13291329        else if (pItem->type() == UIGChooserItemType_Group)
    13301330        {
    1331             /* If it have at least one machine item: */
     1331            /* If that group-item have at least one machine-item: */
    13321332            if (pItem->hasItems(UIGChooserItemType_Machine))
    1333                 /* Iterate over all the machine items recursively: */
    1334                 return searchCurrentItem(pItem->items(UIGChooserItemType_Machine));
    1335             /* If it have at least one group item: */
     1333                /* Iterate over all the machine-items recursively: */
     1334                return firstMachineItem(pItem->items(UIGChooserItemType_Machine));
     1335            /* If that group-item have at least one group-item: */
    13361336            else if (pItem->hasItems(UIGChooserItemType_Group))
    1337                 /* Iterate over all the group items recursively: */
    1338                 return searchCurrentItem(pItem->items(UIGChooserItemType_Group));
     1337                /* Iterate over all the group-items recursively: */
     1338                return firstMachineItem(pItem->items(UIGChooserItemType_Group));
    13391339        }
    13401340    }
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h

    r43540 r43542  
    240240
    241241    /* Helpers: Current-item stuff: */
    242     UIVMItem* searchCurrentItem(const QList<UIGChooserItem*> &list) const;
     242    UIGChooserItemMachine* firstMachineItem(const QList<UIGChooserItem*> &list) const;
    243243    void enumerateCurrentItems(const QList<UIGChooserItem*> &il, QList<UIVMItem*> &ol) const;
    244244    bool contains(const QList<UIVMItem*> &list, UIVMItem *pItem) const;
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