Changeset 102507 in vbox
- Timestamp:
- Dec 6, 2023 3:39:31 PM (12 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.h
r102485 r102507 77 77 bool isGuestSessionRunning() const; 78 78 void setIsCurrent(bool fIsCurrent); 79 virtual bool isWindowsFileSystem() const override final; 79 80 80 81 protected: … … 101 102 virtual void setState(); 102 103 virtual void setSessionDependentWidgetsEnabled(); 103 virtual bool isWindowsFileSystem() const override final;104 104 105 105 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerHostTable.h
r102485 r102507 56 56 static KFsObjType fileType(const QFileInfo &fsInfo); 57 57 static KFsObjType fileType(const QString &strPath); 58 virtual bool isWindowsFileSystem() const override final; 58 59 59 60 protected: … … 76 77 virtual void createFileViewContextMenu(const QWidget *pWidget, const QPoint &point) override final; 77 78 virtual void toggleForwardBackwardActions() override final; 78 virtual bool isWindowsFileSystem() const override final; 79 79 80 /** @name Copy/Cut host-to-host stuff. Currently not implemented. 80 81 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.h
r102485 r102507 166 166 bool hasSelection() const; 167 167 void setDragDropMode(QAbstractItemView::DragDropMode behavior); 168 virtual bool isWindowsFileSystem() const = 0; 168 169 169 170 public slots: … … 227 228 virtual void toggleForwardBackwardActions() = 0; 228 229 virtual bool event(QEvent *pEvent) RT_OVERRIDE; 229 virtual bool isWindowsFileSystem() const = 0; 230 230 231 /** @name Copy/Cut guest-to-guest (host-to-host) stuff. 231 232 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp
r102498 r102507 245 245 , m_pTableView(0) 246 246 , m_pModel(0) 247 , m_p TableProxyModel(0)247 , m_pProxyModel(0) 248 248 , m_pMainLayout(0) 249 249 , m_pToolBar(0) … … 267 267 /* Assuming the root items only child is the one with the path '/', navigate into it. */ 268 268 /* Hack alert. for some reason without invalidating proxy models mapFromSource return invalid index. */ 269 if (m_p TableProxyModel)270 m_p TableProxyModel->invalidate();269 if (m_pProxyModel) 270 m_pProxyModel->invalidate(); 271 271 272 272 if (rootItem() && rootItem()->childCount() > 0) … … 332 332 333 333 } 334 if (m_p TableProxyModel)335 m_p TableProxyModel->invalidate();334 if (m_pProxyModel) 335 m_pProxyModel->invalidate(); 336 336 pParentItem->setIsOpened(true); 337 337 emit sigISOContentImportedOrRemoved(true /* imported*/); … … 356 356 foreach (UIFileSystemItem *pItem, itemsToDelete) 357 357 m_pModel->deleteItem(pItem); 358 if (m_p TableProxyModel)359 m_p TableProxyModel->invalidate();358 if (m_pProxyModel) 359 m_pProxyModel->invalidate(); 360 360 361 361 setImportedISOPath(); … … 369 369 370 370 /* Insert items to the current directory shown in the table view: */ 371 QModelIndex parentIndex = m_p TableProxyModel->mapToSource(m_pTableView->rootIndex());371 QModelIndex parentIndex = m_pProxyModel->mapToSource(m_pTableView->rootIndex()); 372 372 if (!parentIndex.isValid()) 373 373 return; … … 397 397 createVisoEntry(pAddedItem->path(), pAddedItem->data(UIFileSystemModelData_LocalPath).toString(), false); 398 398 } 399 if (m_p TableProxyModel)400 m_p TableProxyModel->invalidate();399 if (m_pProxyModel) 400 m_pProxyModel->invalidate(); 401 401 } 402 402 … … 450 450 void UIVisoContentBrowser::tableViewItemDoubleClick(const QModelIndex &index) 451 451 { 452 if (!index.isValid() || !m_p TableProxyModel)452 if (!index.isValid() || !m_pProxyModel) 453 453 return; 454 454 UIFileSystemItem *pClickedItem = 455 static_cast<UIFileSystemItem*>(m_p TableProxyModel->mapToSource(index).internalPointer());455 static_cast<UIFileSystemItem*>(m_pProxyModel->mapToSource(index).internalPointer()); 456 456 if (!pClickedItem) 457 457 return; … … 487 487 strNewDirectoryName = QString("%1_%2").arg(strBaseName).arg(QString::number(iSuffix++)); 488 488 489 QModelIndex parentIndex = m_p TableProxyModel->mapToSource(m_pTableView->rootIndex());489 QModelIndex parentIndex = m_pProxyModel->mapToSource(m_pTableView->rootIndex()); 490 490 if (!parentIndex.isValid()) 491 491 return; … … 507 507 508 508 pAddedItem->setIsOpened(false); 509 if (m_p TableProxyModel)510 m_p TableProxyModel->invalidate();509 if (m_pProxyModel) 510 m_pProxyModel->invalidate(); 511 511 512 512 renameFileObject(pAddedItem); … … 526 526 { 527 527 AssertReturnVoid(m_pModel); 528 AssertReturnVoid(m_p TableProxyModel);528 AssertReturnVoid(m_pProxyModel); 529 529 foreach(UIFileSystemItem *pItem, itemList) 530 530 { … … 545 545 } 546 546 547 m_p TableProxyModel->invalidate();547 m_pProxyModel->invalidate(); 548 548 } 549 549 … … 566 566 markRemovedUnremovedItemParents(pItem, false); 567 567 } 568 if (m_p TableProxyModel)569 m_p TableProxyModel->invalidate();568 if (m_pProxyModel) 569 m_pProxyModel->invalidate(); 570 570 } 571 571 … … 611 611 612 612 m_pModel = new UIFileSystemModel(this); 613 m_p TableProxyModel = new UIFileSystemProxyModel(this);614 if (m_p TableProxyModel)615 { 616 m_p TableProxyModel->setSourceModel(m_pModel);617 m_p TableProxyModel->setListDirectoriesOnTop(true);613 m_pProxyModel = new UIFileSystemProxyModel(this); 614 if (m_pProxyModel) 615 { 616 m_pProxyModel->setSourceModel(m_pModel); 617 m_pProxyModel->setListDirectoriesOnTop(true); 618 618 } 619 619 … … 645 645 pHorizontalHeader->setSectionResizeMode(QHeaderView::Stretch); 646 646 647 m_pTableView->setModel(m_p TableProxyModel);647 m_pTableView->setModel(m_pProxyModel); 648 648 setTableRootIndex(); 649 649 m_pTableView->hideColumn(UIFileSystemModelData_Owner); … … 974 974 } 975 975 976 if (m_p TableProxyModel)977 m_p TableProxyModel->invalidate();976 if (m_pProxyModel) 977 m_pProxyModel->invalidate(); 978 978 979 979 } … … 997 997 return QModelIndex(); 998 998 999 if (index.model() == m_p TableProxyModel)999 if (index.model() == m_pProxyModel) 1000 1000 return index; 1001 1001 else if (index.model() == m_pModel) 1002 return m_p TableProxyModel->mapFromSource(index);1002 return m_pProxyModel->mapFromSource(index); 1003 1003 return QModelIndex(); 1004 1004 } … … 1065 1065 rootItem()->child(0)->setData(strName, UIFileSystemModelData_Name); 1066 1066 /* If the table root index is the start item then we have to update the location selector text here: */ 1067 // if (m_p TableProxyModel->mapToSource(m_pTableView->rootIndex()).internalPointer() == rootItem()->child(0))1067 // if (m_pProxyModel->mapToSource(m_pTableView->rootIndex()).internalPointer() == rootItem()->child(0)) 1068 1068 // updateLocationSelectorText(strName); 1069 m_p TableProxyModel->invalidate();1069 m_pProxyModel->invalidate(); 1070 1070 } 1071 1071 1072 1072 void UIVisoContentBrowser::renameFileObject(UIFileSystemItem *pItem) 1073 1073 { 1074 m_pTableView->edit(m_p TableProxyModel->mapFromSource(m_pModel->index(pItem)));1074 m_pTableView->edit(m_pProxyModel->mapFromSource(m_pModel->index(pItem))); 1075 1075 } 1076 1076 … … 1115 1115 } 1116 1116 1117 if (m_p TableProxyModel)1118 m_p TableProxyModel->invalidate();1117 if (m_pProxyModel) 1118 m_pProxyModel->invalidate(); 1119 1119 } 1120 1120 … … 1134 1134 rootItem()->child(0)->removeChildren(); 1135 1135 m_entryMap.clear(); 1136 if (m_p TableProxyModel)1137 m_p TableProxyModel->invalidate();1136 if (m_pProxyModel) 1137 m_pProxyModel->invalidate(); 1138 1138 m_strImportedISOPath.clear(); 1139 1139 } … … 1189 1189 { 1190 1190 QList<UIFileSystemItem*> selectedItems; 1191 if (!m_p TableProxyModel)1191 if (!m_pProxyModel) 1192 1192 return selectedItems; 1193 1193 QItemSelectionModel *selectionModel = m_pTableView->selectionModel(); … … 1198 1198 { 1199 1199 UIFileSystemItem *pItem = 1200 static_cast<UIFileSystemItem*>(m_p TableProxyModel->mapToSource(index).internalPointer());1200 static_cast<UIFileSystemItem*>(m_pProxyModel->mapToSource(index).internalPointer()); 1201 1201 if (pItem) 1202 1202 selectedItems << pItem; … … 1209 1209 if (!m_pTableView || !m_pTableView->rootIndex().isValid()) 1210 1210 return QString(); 1211 QModelIndex index = m_p TableProxyModel->mapToSource(m_pTableView->rootIndex());1211 QModelIndex index = m_pProxyModel->mapToSource(m_pTableView->rootIndex()); 1212 1212 UIFileSystemItem *pItem = static_cast<UIFileSystemItem*>((index).internalPointer()); 1213 1213 if (!pItem) … … 1220 1220 if (!m_pTableView || !m_pModel) 1221 1221 return false; 1222 QModelIndex index = m_p TableProxyModel->mapToSource(m_pTableView->rootIndex());1222 QModelIndex index = m_pProxyModel->mapToSource(m_pTableView->rootIndex()); 1223 1223 UIFileSystemItem *pItem = static_cast<UIFileSystemItem*>((index).internalPointer()); 1224 1224 if (!index.isValid() || !pItem) … … 1231 1231 void UIVisoContentBrowser::goUp() 1232 1232 { 1233 AssertReturnVoid(m_p TableProxyModel);1233 AssertReturnVoid(m_pProxyModel); 1234 1234 AssertReturnVoid(m_pTableView); 1235 QModelIndex currentRoot = m_p TableProxyModel->mapToSource(m_pTableView->rootIndex());1235 QModelIndex currentRoot = m_pProxyModel->mapToSource(m_pTableView->rootIndex()); 1236 1236 if (!currentRoot.isValid()) 1237 1237 return; … … 1251 1251 if (!m_pTableView || !m_pTableView->rootIndex().isValid()) 1252 1252 return 0; 1253 QModelIndex currentRoot = m_p TableProxyModel->mapToSource(m_pTableView->rootIndex());1253 QModelIndex currentRoot = m_pProxyModel->mapToSource(m_pTableView->rootIndex()); 1254 1254 1255 1255 return static_cast<UIFileSystemItem*>(currentRoot.internalPointer()); … … 1305 1305 } 1306 1306 1307 void UIVisoContentBrowser::setSortCaseSensitive(bool fCaseSensitive) 1308 { 1309 if (!m_pProxyModel) 1310 return; 1311 if (fCaseSensitive) 1312 m_pProxyModel->setSortCaseSensitivity(Qt::CaseSensitive); 1313 else 1314 m_pProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); 1315 } 1316 1307 1317 #include "UIVisoContentBrowser.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h
r102498 r102507 89 89 bool hasContent() const; 90 90 91 void setSortCaseSensitive(bool fCaseSensitive); 92 91 93 public slots: 92 94 … … 164 166 UIVisoContentTableView *m_pTableView; 165 167 UIFileSystemModel *m_pModel; 166 UIFileSystemProxyModel *m_p TableProxyModel;168 UIFileSystemProxyModel *m_pProxyModel; 167 169 QPointer<QMenu> m_pSubMenu; 168 170 QString m_strImportedISOPath; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r102474 r102507 501 501 AssertPtrReturnVoid(m_pVISOContentBrowser); 502 502 pContainerLayout->addWidget(m_pVISOContentBrowser, 0, 5, 1, 4); 503 /* Set content browsers sort case sensitivity wrt. host's file system: */ 504 m_pVISOContentBrowser->setSortCaseSensitive(!m_pHostFileBrowser->isWindowsFileSystem()); 503 505 504 506 m_pSettingsWidget = new UIVisoSettingWidget(this);
Note:
See TracChangeset
for help on using the changeset viewer.