VirtualBox

Changeset 96767 in vbox


Ignore:
Timestamp:
Sep 16, 2022 12:10:55 PM (2 years ago)
Author:
vboxsync
Message:

Unattended: bugref:10141. Automatically navigate into VISO content's root directory.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp

    r96407 r96767  
    164164    prepareObjects();
    165165    prepareConnections();
     166
     167    /* Assuming the root items only child is the one with the path '/', navigate into it. */
     168    /* Hack alert. for some reason without invalidating proxy models mapFromSource return invalid index. */
     169    if (m_pTableProxyModel)
     170        m_pTableProxyModel->invalidate();
     171    if (m_pTreeProxyModel)
     172        m_pTreeProxyModel->setSourceModel(m_pModel);
     173    if (rootItem() && rootItem()->childCount() > 0)
     174    {
     175        UICustomFileSystemItem *pStartItem = static_cast<UICustomFileSystemItem*>(rootItem()->children()[0]);
     176        if (pStartItem)
     177        {
     178            QModelIndex iindex = m_pModel->index(pStartItem);
     179            if (iindex.isValid())
     180                tableViewItemDoubleClick(convertIndexToTableIndex(iindex));
     181        }
     182    }
    166183}
    167184
     
    472489    const QString startPath = QString("/%1").arg(m_strVisoName);
    473490
    474     UICustomFileSystemItem* startItem = new UICustomFileSystemItem(startPath, rootItem(), KFsObjType_Directory);
    475     startItem->setPath("/");
    476     startItem->setIsOpened(false);
     491    UICustomFileSystemItem *pStartItem = new UICustomFileSystemItem(startPath, rootItem(), KFsObjType_Directory);
     492    pStartItem->setPath("/");
     493    pStartItem->setIsOpened(false);
    477494}
    478495
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h

    r96407 r96767  
    9393
    9494    virtual void treeSelectionChanged(const QModelIndex &selectedTreeIndex) final override;
    95 
     95   
    9696private slots:
    9797
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