VirtualBox

Changeset 100460 in vbox for trunk


Ignore:
Timestamp:
Jul 10, 2023 2:08:18 PM (17 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Don't store viso path in data field as it is redundant.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.cpp

    r100419 r100460  
    650650    m_pRootItem->setData(UICustomFileSystemModel::tr("Permissions"), UICustomFileSystemModelData_Permissions);
    651651    m_pRootItem->setData(UICustomFileSystemModel::tr("Local Path"), UICustomFileSystemModelData_LocalPath);
    652     m_pRootItem->setData(UICustomFileSystemModel::tr("Path"), UICustomFileSystemModelData_VISOPath);
    653 }
     652}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.h

    r100419 r100460  
    4848    UICustomFileSystemModelData_Owner,
    4949    UICustomFileSystemModelData_Permissions,
    50     UICustomFileSystemModelData_VISOPath,
    5150    UICustomFileSystemModelData_LocalPath,
    5251    UICustomFileSystemModelData_ISOFilePath, /* in case of import-iso this contains full path of the container iso file. */
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp

    r100455 r100460  
    496496        connect(m_pView, &UIGuestControlFileView::customContextMenuRequested,
    497497                this, &UIFileManagerTable::sltCreateFileViewContextMenu);
    498         m_pView->hideColumn(UICustomFileSystemModelData_VISOPath);
    499498        m_pView->hideColumn(UICustomFileSystemModelData_LocalPath);
    500499        m_sessionWidgets << m_pView;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp

    r100457 r100460  
    307307        UICustomFileSystemItem* pAddedItem = new UICustomFileSystemItem(fileInfo.fileName(), pParentItem,
    308308                                                                        objectList[i].enmObjectType);
    309         /* VISOPAth and LocalPath is the same since we allow importing ISO content only to VISO root:*/
     309
    310310        QString path = UIPathOperations::mergePaths(pParentItem->path(), fileInfo.fileName());
    311311        pAddedItem->setData(path, UICustomFileSystemModelData_LocalPath);
    312312        pAddedItem->setData(strISOFilePath, UICustomFileSystemModelData_ISOFilePath);
    313         pAddedItem->setData(path, UICustomFileSystemModelData_VISOPath);
    314313        pAddedItem->setIsOpened(false);
    315314        // if (fileInfo.isSymLink())
     
    375374                                                                        fileType(fileInfo));
    376375        pAddedItem->setData(strPath, UICustomFileSystemModelData_LocalPath);
    377         pAddedItem->setData(UIPathOperations::mergePaths(pParentItem->path(), fileInfo.fileName()),
    378                            UICustomFileSystemModelData_VISOPath);
     376
    379377        pAddedItem->setIsOpened(false);
    380378        if (fileInfo.isSymLink())
     
    393391    if (!pItem)
    394392        return;
    395     if (pItem->data(UICustomFileSystemModelData_VISOPath).toString().isEmpty())
     393    if (pItem->path().isEmpty())
    396394        return;
    397395
     
    400398        return;
    401399    if (!bRemove)
    402         m_entryMap.insert(pItem->data(UICustomFileSystemModelData_VISOPath).toString(),
     400        m_entryMap.insert(pItem->path(),
    403401                          pItem->data(UICustomFileSystemModelData_LocalPath).toString());
    404402    else
    405         m_entryMap.insert(pItem->data(UICustomFileSystemModelData_VISOPath).toString(),
     403        m_entryMap.insert(pItem->path(),
    406404                          ":remove:");
    407405}
     
    431429        pRootItem->setData(QApplication::translate("UIVisoCreatorWidget", "Permissions"), UICustomFileSystemModelData_Permissions);
    432430        pRootItem->setData(QApplication::translate("UIVisoCreatorWidget", "Local Path"), UICustomFileSystemModelData_LocalPath);
    433         pRootItem->setData(QApplication::translate("UIVisoCreatorWidget", "VISO Path"), UICustomFileSystemModelData_VISOPath);
    434431    }
    435432    setFileTableLabelText(QApplication::translate("UIVisoCreatorWidget","VISO Content"));
     
    490487    UICustomFileSystemItem* pAddedItem = new UICustomFileSystemItem(strNewDirectoryName, pParentItem,
    491488                                                                    KFsObjType_Directory);
    492     pAddedItem->setData(UIPathOperations::mergePaths(pParentItem->path(), strNewDirectoryName), UICustomFileSystemModelData_VISOPath);
    493489
    494490    pAddedItem->setIsOpened(false);
     
    510506        if (!pItem)
    511507            continue;
    512         QString strIsoPath = pItem->data(UICustomFileSystemModelData_VISOPath).toString();
     508        QString strIsoPath = pItem->path();
    513509        if (strIsoPath.isEmpty())
    514510            continue;
     
    876872                    continue;
    877873
    878                 pItem->setData(strPath, UICustomFileSystemModelData_VISOPath);
    879874                if (i == pathList.size() - 1)
    880875                    pItem->setData(strLocalPath, UICustomFileSystemModelData_LocalPath);
     
    926921            newItem->setData(fileInfo.filePath(), UICustomFileSystemModelData_LocalPath);
    927922
    928             newItem->setData(UIPathOperations::mergePaths(directoryItem->path(), fileInfo.fileName()),
    929                              UICustomFileSystemModelData_VISOPath);
    930923            if (fileInfo.isSymLink())
    931924            {
     
    983976                                                const QString &strOldName, const QString &strNewName)
    984977{
    985     Q_UNUSED(strOldPath);
    986978    if (!pItem || !pItem->parentItem())
    987979        return;
     
    993985            bDuplicate = true;
    994986    }
     987
    995988    QString strNewPath = UIPathOperations::mergePaths(pItem->parentItem()->path(), pItem->fileObjectName());
    996989
     
    1006999           VISO file for the old path since in some cases, when remaned item is not top level, it still
    10071000           appears in ISO. So we remove it explicitly: */
    1008         QString oldItemPath = pItem->data(UICustomFileSystemModelData_VISOPath).toString();
    10091001        m_entryMap.insert(strNewPath, pItem->data(UICustomFileSystemModelData_LocalPath).toString());
    1010         m_entryMap.remove(oldItemPath);
     1002        m_entryMap.remove(strOldPath);
    10111003        if (!pItem->data(UICustomFileSystemModelData_LocalPath).toString().isEmpty())
    1012             m_entryMap.insert(oldItemPath, ":remove:");
    1013     }
    1014 
    1015     pItem->setData(strNewPath, UICustomFileSystemModelData_VISOPath);
     1004            m_entryMap.insert(strOldPath, ":remove:");
     1005    }
    10161006
    10171007    if (m_pTableProxyModel)
     
    10911081    if (!pItem)
    10921082        return QString();
    1093     return pItem->path();//data(UICustomFileSystemModelData_VISOPath).toString();
     1083    return pItem->path();
    10941084}
    10951085
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