VirtualBox

Changeset 100092 in vbox


Ignore:
Timestamp:
Jun 7, 2023 10:26:43 AM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Finished the work on item rename.

File:
1 edited

Legend:

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

    r100082 r100092  
    731731            bDuplicate = true;
    732732    }
     733    QString strNewPath = UIPathOperations::mergePaths(pItem->parentItem()->path(), pItem->name());
    733734
    734735    if (bDuplicate)
     
    737738        pItem->setData(strOldName, static_cast<int>(UICustomFileSystemModelData_Name));
    738739    }
    739 
    740     pItem->setData(UIPathOperations::mergePaths(pItem->parentItem()->path(), pItem->name()), UICustomFileSystemModelData_ISOPath);
     740    else
     741    {
     742        /* In case renaming is done (no dublicates) then modify the map that holds VISO items by:
     743           adding the renamed item, removing the old one (if it exists) and also add a :remove: to
     744           VISO file for the old path since in some cases, when remaned item is not top level, it still
     745           appears in ISO. So we remove it explicitly: */
     746        QString oldItemPath = pItem->data(UICustomFileSystemModelData_ISOPath).toString();
     747        m_entryMap.insert(strNewPath, pItem->data(UICustomFileSystemModelData_LocalPath).toString());
     748        m_entryMap.remove(oldItemPath);
     749        if (!pItem->data(UICustomFileSystemModelData_LocalPath).toString().isEmpty())
     750            m_entryMap.insert(oldItemPath, ":remove:");
     751    }
     752
     753    pItem->setData(strNewPath, UICustomFileSystemModelData_ISOPath);
     754
    741755    if (m_pTableProxyModel)
    742756        m_pTableProxyModel->invalidate();
     757
     758
    743759}
    744760
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