VirtualBox

Changeset 107637 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 10, 2025 12:32:20 PM (4 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:3409: VISO browser: Fixing false-positive parfait warnings related to null pointer dereference.

File:
1 edited

Legend:

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

    r106467 r107637  
    10681068void UIVisoContentBrowser::updateStartItemName()
    10691069{
    1070     if (!rootItem() || !rootItem()->child(0))
     1070    UIFileSystemItem *pRoot = rootItem();
     1071    if (!pRoot)
     1072        return;
     1073    UIFileSystemItem *pChild = pRoot->child(0);
     1074    if (!pChild)
    10711075        return;
    10721076    const QString strName(QDir::toNativeSeparators("/"));
    10731077
    1074     rootItem()->child(0)->setData(strName, UIFileSystemModelData_Name);
     1078    pChild->setData(strName, UIFileSystemModelData_Name);
    10751079    /* If the table root index is the start item then we have to update the location selector text here: */
    1076     // if (m_pProxyModel->mapToSource(m_pTableView->rootIndex()).internalPointer() == rootItem()->child(0))
     1080    // if (m_pProxyModel->mapToSource(m_pTableView->rootIndex()).internalPointer() == pChild)
    10771081    //     updateLocationSelectorText(strName);
    10781082    m_pProxyModel->invalidate();
     
    11381142void UIVisoContentBrowser::sltResetAction()
    11391143{
    1140     if (!rootItem() || !rootItem()->child(0))
     1144    UIFileSystemItem *pRoot = rootItem();
     1145    if (!pRoot)
     1146        return;
     1147    UIFileSystemItem *pChild = pRoot->child(0);
     1148    if (!pChild)
    11411149        return;
    11421150    goToStart();
    1143     rootItem()->child(0)->removeChildren();
     1151    pChild->removeChildren();
    11441152    m_entryMap.clear();
    11451153    if (m_pProxyModel)
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