- Timestamp:
- Mar 21, 2023 3:04:25 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp
r98103 r99089 528 528 if (directory.isOk()) 529 529 { 530 CFsObjInfo fsInfo = directory.Read(); 530 int const cMaxEntries = _4K; /* Maximum number of entries to read at once per List() call. */ 531 532 QVector<CFsObjInfo> vecFsInfo = directory.List(cMaxEntries); 531 533 QMap<QString, UICustomFileSystemItem*> fileObjects; 532 534 533 while ( fsInfo.isOk())534 { 535 if (fsInfo.GetName() != "." && fsInfo.GetName() != "..")535 while (directory.isOk()) 536 { 537 for (int i = 0; i < vecFsInfo.size(); i++) 536 538 { 537 QVector<QVariant> data; 538 QDateTime changeTime = QDateTime::fromMSecsSinceEpoch(fsInfo.GetChangeTime()/RT_NS_1MS); 539 KFsObjType fsObjectType = fileType(fsInfo); 540 UICustomFileSystemItem *item = new UICustomFileSystemItem(fsInfo.GetName(), parent, fsObjectType); 541 if (!item) 542 continue; 543 item->setData(static_cast<qulonglong>(fsInfo.GetObjectSize()), UICustomFileSystemModelColumn_Size); 544 item->setData(changeTime, UICustomFileSystemModelColumn_ChangeTime); 545 item->setData(fsInfo.GetUserName(), UICustomFileSystemModelColumn_Owner); 546 item->setData(permissionString(fsInfo), UICustomFileSystemModelColumn_Permissions); 547 item->setPath(UIPathOperations::removeTrailingDelimiters(UIPathOperations::mergePaths(strPath, fsInfo.GetName()))); 548 item->setIsOpened(false); 549 item->setIsHidden(isFileObjectHidden(fsInfo)); 550 fileObjects.insert(fsInfo.GetName(), item); 551 /* @todo. We will need to wait a fully implemented SymlinkRead function 552 * to be able to handle sym links properly: */ 553 // QString path = UIPathOperations::mergePaths(strPath, fsInfo.GetName()); 554 // QVector<KSymlinkReadFlag> aFlags; 555 // printf("%s %s %s\n", qPrintable(fsInfo.GetName()), qPrintable(path), 556 // qPrintable(m_comGuestSession.SymlinkRead(path, aFlags))); 539 CFsObjInfo const &fsInfo = vecFsInfo[i]; 540 541 if (fsInfo.GetName() != "." && fsInfo.GetName() != "..") 542 { 543 QVector<QVariant> data; 544 QDateTime changeTime = QDateTime::fromMSecsSinceEpoch(fsInfo.GetChangeTime()/RT_NS_1MS); 545 KFsObjType fsObjectType = fileType(fsInfo); 546 UICustomFileSystemItem *item = new UICustomFileSystemItem(fsInfo.GetName(), parent, fsObjectType); 547 if (!item) 548 continue; 549 item->setData(static_cast<qulonglong>(fsInfo.GetObjectSize()), UICustomFileSystemModelColumn_Size); 550 item->setData(changeTime, UICustomFileSystemModelColumn_ChangeTime); 551 item->setData(fsInfo.GetUserName(), UICustomFileSystemModelColumn_Owner); 552 item->setData(permissionString(fsInfo), UICustomFileSystemModelColumn_Permissions); 553 item->setPath(UIPathOperations::removeTrailingDelimiters(UIPathOperations::mergePaths(strPath, fsInfo.GetName()))); 554 item->setIsOpened(false); 555 item->setIsHidden(isFileObjectHidden(fsInfo)); 556 fileObjects.insert(fsInfo.GetName(), item); 557 /* @todo. We will need to wait a fully implemented SymlinkRead function 558 * to be able to handle sym links properly: */ 559 // QString path = UIPathOperations::mergePaths(strPath, fsInfo.GetName()); 560 // QVector<KSymlinkReadFlag> aFlags; 561 // printf("%s %s %s\n", qPrintable(fsInfo.GetName()), qPrintable(path), 562 // qPrintable(m_comGuestSession.SymlinkRead(path, aFlags))); 563 } 557 564 } 558 fsInfo = directory.Read(); 559 } 565 566 vecFsInfo = directory.List(cMaxEntries); 567 } 568 560 569 checkDotDot(fileObjects, parent, isStartDir); 561 570 } 571 562 572 directory.Close(); 563 573 }
Note:
See TracChangeset
for help on using the changeset viewer.