VirtualBox

Ignore:
Timestamp:
Oct 26, 2018 2:34:21 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Tools pane: Sane default values in case if items restored from extra-data are missing.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r75096 r75099  
    317317}
    318318
     319UIToolsItem *UIToolsModel::item(UIToolType enmType) const
     320{
     321    foreach (UIToolsItem *pItem, items())
     322        if (pItem->itemType() == enmType)
     323            return pItem;
     324    return 0;
     325}
     326
    319327void UIToolsModel::updateLayout()
    320328{
     
    509517        if (pItem->itemType() == enmTypeGlobal)
    510518            m_pLastItemGlobal = pItem;
    511     AssertPtr(m_pLastItemGlobal.data());
     519    if (m_pLastItemGlobal.isNull())
     520        m_pLastItemGlobal = item(UIToolType_Welcome);
    512521
    513522    /* Second of them is current machine class item definition: */
     
    518527        if (pItem->itemType() == enmTypeMachine)
    519528            m_pLastItemMachine = pItem;
    520     AssertPtr(m_pLastItemMachine.data());
     529    if (m_pLastItemMachine.isNull())
     530        m_pLastItemMachine = item(UIToolType_Details);
    521531}
    522532
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.h

    r75081 r75099  
    123123    /** @name Children stuff.
    124124      * @{ */
    125         /** Holds the item list. */
     125        /** Returns the item list. */
    126126        QList<UIToolsItem*> items() const;
     127
     128        /** Returns the item of passed @a enmType. */
     129        UIToolsItem *item(UIToolType enmType) const;
    127130    /** @} */
    128131
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