Changeset 43542 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 4, 2012 1:28:09 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 81145
- 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 188 188 UIVMItem* UIGChooserModel::currentMachineItem() const 189 189 { 190 /* Search for the first selected machine: */191 return searchCurrentItem(currentItems());190 /* Return first machine-item: */ 191 return firstMachineItem(currentItems()); 192 192 } 193 193 … … 1315 1315 } 1316 1316 1317 UI VMItem* UIGChooserModel::searchCurrentItem(const QList<UIGChooserItem*> &list) const1317 UIGChooserItemMachine* UIGChooserModel::firstMachineItem(const QList<UIGChooserItem*> &list) const 1318 1318 { 1319 1319 /* Iterate over all the passed items: */ 1320 1320 foreach (UIGChooserItem *pItem, list) 1321 1321 { 1322 /* If item is machine, just return it: */1322 /* If that is machine-item, just return it: */ 1323 1323 if (pItem->type() == UIGChooserItemType_Machine) 1324 1324 { … … 1326 1326 return pMachineItem; 1327 1327 } 1328 /* If item is group: */1328 /* If that is group-item: */ 1329 1329 else if (pItem->type() == UIGChooserItemType_Group) 1330 1330 { 1331 /* If it have at least one machineitem: */1331 /* If that group-item have at least one machine-item: */ 1332 1332 if (pItem->hasItems(UIGChooserItemType_Machine)) 1333 /* Iterate over all the machine 1334 return searchCurrentItem(pItem->items(UIGChooserItemType_Machine));1335 /* If it have at least one groupitem: */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: */ 1336 1336 else if (pItem->hasItems(UIGChooserItemType_Group)) 1337 /* Iterate over all the group 1338 return searchCurrentItem(pItem->items(UIGChooserItemType_Group));1337 /* Iterate over all the group-items recursively: */ 1338 return firstMachineItem(pItem->items(UIGChooserItemType_Group)); 1339 1339 } 1340 1340 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r43540 r43542 240 240 241 241 /* Helpers: Current-item stuff: */ 242 UI VMItem* searchCurrentItem(const QList<UIGChooserItem*> &list) const;242 UIGChooserItemMachine* firstMachineItem(const QList<UIGChooserItem*> &list) const; 243 243 void enumerateCurrentItems(const QList<UIGChooserItem*> &il, QList<UIVMItem*> &ol) const; 244 244 bool contains(const QList<UIVMItem*> &list, UIVMItem *pItem) const;
Note:
See TracChangeset
for help on using the changeset viewer.