Changeset 100418 in vbox for trunk/src/VBox
- Timestamp:
- Jul 6, 2023 5:26:08 PM (17 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.cpp
r100410 r100418 77 77 } 78 78 79 void UICustomFileSystemItem::childRenamed() 80 { 81 /* Recreate child map to accomadate the new file object name of the children: */ 82 m_childMap.clear(); 83 foreach(UICustomFileSystemItem* pItem, m_childItems) 84 m_childMap[pItem->fileObjectName()] = pItem; 85 } 86 79 87 void UICustomFileSystemItem::reset() 80 88 { … … 150 158 void UICustomFileSystemItem::setData(const QVariant &data, int index) 151 159 { 160 if (m_itemData[static_cast<UICustomFileSystemModelData>(index)] == data) 161 return; 152 162 m_itemData[static_cast<UICustomFileSystemModelData>(index)] = data; 163 if (static_cast<UICustomFileSystemModelData>(index) == UICustomFileSystemModelData_Name && parentItem()) 164 parentItem()->childRenamed(); 153 165 } 154 166 … … 220 232 221 233 return UIPathOperations::removeMultipleDelimiters(path.join("/")); 222 }223 224 void UICustomFileSystemItem::setPath(const QString &path)225 {226 if (path.isNull() || path.isEmpty())227 return;228 m_itemData[UICustomFileSystemModelData_VISOPath] = path;229 234 } 230 235 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.h
r100410 r100418 90 90 /** Full absolute path of the item. With or without the trailing '/' */ 91 91 QString path(bool fRemoveTrailingDelimiters = false) const; 92 void setPath(const QString &path);93 92 94 93 /** Returns true if this is directory and file object name is ".." */ … … 118 117 119 118 private: 119 120 120 void appendChild(UICustomFileSystemItem *child); 121 121 void childRenamed(); 122 122 QList<UICustomFileSystemItem*> m_childItems; 123 123 /** Used to find children by file object name */ -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp
r100410 r100418 569 569 item->setData(fsInfo.GetUserName(), UICustomFileSystemModelData_Owner); 570 570 item->setData(permissionString(fsInfo), UICustomFileSystemModelData_Permissions); 571 item->setPath(UIPathOperations::removeTrailingDelimiters(UIPathOperations::mergePaths(strPath, fsInfo.GetName())));572 571 item->setIsOpened(false); 573 572 item->setIsHidden(isFileObjectHidden(fsInfo)); -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerHostTable.cpp
r100410 r100418 166 166 item->setData(fileInfo.owner(), UICustomFileSystemModelData_Owner); 167 167 item->setData(permissionString(fileInfo.permissions()), UICustomFileSystemModelData_Permissions); 168 item->setPath(fileInfo.absoluteFilePath()); 168 169 169 /* if the item is a symlink set the target path and 170 170 check the target if it is a directory: */ -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp
r100410 r100418 520 520 { 521 521 if (m_pNavigationWidget) 522 {523 522 m_pNavigationWidget->setPath(strLocation); 524 }525 523 } 526 524 … … 553 551 const QString startPath("/"); 554 552 UICustomFileSystemItem* startItem = new UICustomFileSystemItem(startPath, rootItem(), KFsObjType_Directory); 555 startItem->setPath(startPath); 553 556 554 startItem->setIsOpened(false); 557 555 populateStartDirectory(startItem); … … 576 574 UICustomFileSystemItem* driveItem = new UICustomFileSystemItem(UIPathOperations::removeTrailingDelimiters(m_driveLetterList[i]), 577 575 startItem, KFsObjType_Directory); 578 driveItem->setPath(m_driveLetterList[i]);579 576 driveItem->setIsOpened(false); 580 577 driveItem->setIsDriveItem(true); … … 702 699 /* search the current path item among the parent's children: */ 703 700 UICustomFileSystemItem *item = parent->child(pathTrail.at(i)); 701 704 702 if (!item) 705 703 return; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp
r100410 r100418 718 718 719 719 UICustomFileSystemItem *pStartItem = new UICustomFileSystemItem(startPath, rootItem(), KFsObjType_Directory); 720 pStartItem->setPath("/"); 720 721 721 pStartItem->setIsOpened(false); 722 722 }
Note:
See TracChangeset
for help on using the changeset viewer.