Changeset 43619 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 11, 2012 2:07:55 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 81332
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h
r43617 r43619 107 107 virtual void clearItems(UIGChooserItemType type = UIGChooserItemType_Any) = 0; 108 108 virtual void updateAll(const QString &strId) = 0; 109 virtual void removeAll(const QString &strId) = 0; 109 110 virtual UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0; 110 111 virtual UIGChooserItemMachine* firstMachineItem() = 0; -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43617 r43619 734 734 void UIGChooserItemGroup::updateAll(const QString &strId) 735 735 { 736 /* Update all the items: */736 /* Update all the required items recursively: */ 737 737 foreach (UIGChooserItem *pItem, items()) 738 738 pItem->updateAll(strId); 739 } 740 741 void UIGChooserItemGroup::removeAll(const QString &strId) 742 { 743 /* Remove all the required items recursively: */ 744 foreach (UIGChooserItem *pItem, items()) 745 pItem->removeAll(strId); 739 746 } 740 747 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
r43617 r43619 147 147 void clearItems(UIGChooserItemType type = UIGChooserItemType_Any); 148 148 void updateAll(const QString &strId); 149 void removeAll(const QString &strId); 149 150 UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags); 150 151 UIGChooserItemMachine* firstMachineItem(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp
r43617 r43619 376 376 } 377 377 378 void UIGChooserItemMachine::removeAll(const QString &strId) 379 { 380 /* Skip wrong id: */ 381 if (id() != strId) 382 return; 383 384 /* Remove item: */ 385 delete this; 386 } 387 378 388 UIGChooserItem* UIGChooserItemMachine::searchForItem(const QString &strSearchTag, int iItemSearchFlags) 379 389 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h
r43617 r43619 123 123 void clearItems(UIGChooserItemType type); 124 124 void updateAll(const QString &strId); 125 void removeAll(const QString &strId); 125 126 UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags); 126 127 UIGChooserItemMachine* firstMachineItem(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r43617 r43619 621 621 { 622 622 /* Remove machine-items with passed id: */ 623 removeMachineItems(strId, mainRoot());623 mainRoot()->removeAll(strId); 624 624 /* Update model: */ 625 625 cleanupGroupTree(); … … 885 885 { 886 886 /* Remove all the items first: */ 887 removeMachineItems(strId, mainRoot());887 mainRoot()->removeAll(strId); 888 888 889 889 /* Check if such machine still present: */ … … 1418 1418 unindentRoot(); 1419 1419 } 1420 }1421 1422 void UIGChooserModel::removeMachineItems(const QString &strId, UIGChooserItem *pParent)1423 {1424 /* For each group-item in passed parent: */1425 foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Group))1426 removeMachineItems(strId, pItem->toGroupItem());1427 /* For each machine-item in passed parent: */1428 foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Machine))1429 if (pItem->toMachineItem()->id() == strId)1430 delete pItem;1431 1420 } 1432 1421 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r43617 r43619 247 247 248 248 /* Helpers: Machine-item stuff: */ 249 void removeMachineItems(const QString &strId, UIGChooserItem *pParent);250 249 void removeItems(const QList<UIGChooserItem*> &itemsToRemove); 251 250 void unregisterMachines(const QStringList &ids);
Note:
See TracChangeset
for help on using the changeset viewer.