VirtualBox

Changeset 50715 in vbox


Ignore:
Timestamp:
Mar 6, 2014 2:26:26 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Medium Manager rework/cleanup: Properly update tab-icons after inaccessible medium collision resolved.

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  
    12391239            {
    12401240                /* 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);
    12431244                *pfInaccessible = !!pInaccessibleMediumItem;
    12441245            }
     
    17981799}
    17991800
    1800 UIMediumItem* UIMediumManager::searchItem(QTreeWidget *pTree, const CheckIfSuitableBy &functor) const
     1801UIMediumItem* UIMediumManager::searchItem(QTreeWidget *pTree, const CheckIfSuitableBy &condition, CheckIfSuitableBy *pException) const
    18011802{
    18021803    /* Make sure argument is valid: */
     
    18051806
    18061807    /* Return wrapper: */
    1807     return searchItem(pTree->invisibleRootItem(), functor);
    1808 }
    1809 
    1810 UIMediumItem* UIMediumManager::searchItem(QTreeWidgetItem *pParentItem, const CheckIfSuitableBy &functor) const
     1808    return searchItem(pTree->invisibleRootItem(), condition, pException);
     1809}
     1810
     1811UIMediumItem* UIMediumManager::searchItem(QTreeWidgetItem *pParentItem, const CheckIfSuitableBy &condition, CheckIfSuitableBy *pException) const
    18111812{
    18121813    /* Make sure argument is valid: */
     
    18161817    /* Verify passed item if it is of 'medium' type too: */
    18171818    if (UIMediumItem *pMediumParentItem = toMediumItem(pParentItem))
    1818         if (functor.isItSuitable(pMediumParentItem))
     1819        if (   condition.isItSuitable(pMediumParentItem)
     1820            && (!pException || !pException->isItSuitable(pMediumParentItem)))
    18191821            return pMediumParentItem;
    18201822
     
    18221824    for (int iChildIndex = 0; iChildIndex < pParentItem->childCount(); ++iChildIndex)
    18231825        if (UIMediumItem *pMediumChildItem = toMediumItem(pParentItem->child(iChildIndex)))
    1824             if (UIMediumItem *pRequiredMediumChildItem = searchItem(pMediumChildItem, functor))
     1826            if (UIMediumItem *pRequiredMediumChildItem = searchItem(pMediumChildItem, condition, pException))
    18251827                return pRequiredMediumChildItem;
    18261828
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h

    r50712 r50715  
    189189    void setCurrentItem(QTreeWidget *pTreeWidget, QTreeWidgetItem *pItem);
    190190
    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;
    193193    UIMediumItem* createHardDiskItem(QTreeWidget *pTree, const UIMedium &medium) const;
    194194
Note: See TracChangeset for help on using the changeset viewer.

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