Changeset 50715 in vbox
- Timestamp:
- Mar 6, 2014 2:26:26 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/medium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r50712 r50715 1239 1239 { 1240 1240 /* Find the first KMediumState_Inaccessible item to be in charge: */ 1241 UIMediumItem *pInaccessibleMediumItem = 1242 searchItem(pMediumItem->treeWidget(), CheckIfSuitableByState(KMediumState_Inaccessible)); 1241 CheckIfSuitableByState lookForState(KMediumState_Inaccessible); 1242 CheckIfSuitableByID ignoreID(pMediumItem->id()); 1243 UIMediumItem *pInaccessibleMediumItem = searchItem(pMediumItem->treeWidget(), lookForState, &ignoreID); 1243 1244 *pfInaccessible = !!pInaccessibleMediumItem; 1244 1245 } … … 1798 1799 } 1799 1800 1800 UIMediumItem* UIMediumManager::searchItem(QTreeWidget *pTree, const CheckIfSuitableBy & functor) const1801 UIMediumItem* UIMediumManager::searchItem(QTreeWidget *pTree, const CheckIfSuitableBy &condition, CheckIfSuitableBy *pException) const 1801 1802 { 1802 1803 /* Make sure argument is valid: */ … … 1805 1806 1806 1807 /* Return wrapper: */ 1807 return searchItem(pTree->invisibleRootItem(), functor);1808 } 1809 1810 UIMediumItem* UIMediumManager::searchItem(QTreeWidgetItem *pParentItem, const CheckIfSuitableBy & functor) const1808 return searchItem(pTree->invisibleRootItem(), condition, pException); 1809 } 1810 1811 UIMediumItem* UIMediumManager::searchItem(QTreeWidgetItem *pParentItem, const CheckIfSuitableBy &condition, CheckIfSuitableBy *pException) const 1811 1812 { 1812 1813 /* Make sure argument is valid: */ … … 1816 1817 /* Verify passed item if it is of 'medium' type too: */ 1817 1818 if (UIMediumItem *pMediumParentItem = toMediumItem(pParentItem)) 1818 if (functor.isItSuitable(pMediumParentItem)) 1819 if ( condition.isItSuitable(pMediumParentItem) 1820 && (!pException || !pException->isItSuitable(pMediumParentItem))) 1819 1821 return pMediumParentItem; 1820 1822 … … 1822 1824 for (int iChildIndex = 0; iChildIndex < pParentItem->childCount(); ++iChildIndex) 1823 1825 if (UIMediumItem *pMediumChildItem = toMediumItem(pParentItem->child(iChildIndex))) 1824 if (UIMediumItem *pRequiredMediumChildItem = searchItem(pMediumChildItem, functor))1826 if (UIMediumItem *pRequiredMediumChildItem = searchItem(pMediumChildItem, condition, pException)) 1825 1827 return pRequiredMediumChildItem; 1826 1828 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r50712 r50715 189 189 void setCurrentItem(QTreeWidget *pTreeWidget, QTreeWidgetItem *pItem); 190 190 191 UIMediumItem* searchItem(QTreeWidget *pTree, const CheckIfSuitableBy & functor) const;192 UIMediumItem* searchItem(QTreeWidgetItem *pParentItem, const CheckIfSuitableBy & functor) const;191 UIMediumItem* searchItem(QTreeWidget *pTree, const CheckIfSuitableBy &condition, CheckIfSuitableBy *pException = 0) const; 192 UIMediumItem* searchItem(QTreeWidgetItem *pParentItem, const CheckIfSuitableBy &condition, CheckIfSuitableBy *pException = 0) const; 193 193 UIMediumItem* createHardDiskItem(QTreeWidget *pTree, const UIMedium &medium) const; 194 194
Note:
See TracChangeset
for help on using the changeset viewer.