Changeset 71852 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 12, 2018 3:39:09 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp
r71832 r71852 1008 1008 if (m_pRootItem) 1009 1009 reset(); 1010 determineDriveLetters(); 1010 1011 1011 /* Root item: */ 1012 1012 const QString startPath("/"); … … 1021 1021 m_pRootItem->appendChild(startItem); 1022 1022 startItem->setIsOpened(false); 1023 populateStartDirectory(startItem); 1024 m_pView->setRootIndex(m_pModel->rootIndex()); 1025 m_pModel->signalUpdate(); 1026 updateCurrentLocationEdit(startPath); 1027 } 1028 1029 void UIGuestControlFileTable::populateStartDirectory(UIFileTableItem *startItem) 1030 { 1031 determineDriveLetters(); 1023 1032 if (m_driveLetterList.isEmpty()) 1024 1033 { 1025 1034 /* Read the root directory and get the list: */ 1026 readDirectory(start Path, startItem, true);1035 readDirectory(startItem->path(), startItem, true); 1027 1036 } 1028 1037 else … … 1041 1050 } 1042 1051 } 1043 m_pView->setRootIndex(m_pModel->rootIndex()); 1044 m_pModel->signalUpdate(); 1045 updateCurrentLocationEdit(startPath); 1052 1046 1053 } 1047 1054 … … 1192 1199 /* For now we clear the whole subtree (that isrecursively) which is an overkill: */ 1193 1200 treeItem->clearChildren(); 1194 readDirectory(treeItem->path(), treeItem, isRootDir); 1201 if (isRootDir) 1202 populateStartDirectory(treeItem); 1203 else 1204 readDirectory(treeItem->path(), treeItem, isRootDir); 1195 1205 m_pModel->endReset(); 1196 1206 m_pView->setRootIndex(currentIndex); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h
r71832 r71852 336 336 void deSelectUpDirectoryItem(); 337 337 void setSelectionForAll(QItemSelectionModel::SelectionFlags flags); 338 /** Start directory requires a special attention since on file systems with drive letters 339 * drive letter are direct children of the start directory. On other systems start directory is '/' */ 340 void populateStartDirectory(UIFileTableItem *startItem); 338 341 QGridLayout *m_pMainLayout; 339 342 QComboBox *m_pLocationComboBox; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.cpp
r71832 r71852 383 383 void UIHostFileTable::determineDriveLetters() 384 384 { 385 //#ifdef VBOX_WS_WIN 386 387 QFileInfoList drive = QDir::drives(); 388 389 for (int i = 0; i < drive.size(); ++i) 390 { 391 m_driveLetterList.push_back(drive[i].filePath()); 392 393 } 394 //#endif 385 395 } 386 396
Note:
See TracChangeset
for help on using the changeset viewer.