Changeset 71861 in vbox for trunk/src/VBox
- Timestamp:
- Apr 13, 2018 2:11:11 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp
r71852 r71861 1012 1012 const QString startPath("/"); 1013 1013 QList<QVariant> headData; 1014 headData << "Name" << "Size" << "Change Time" << "Owner" ;1014 headData << "Name" << "Size" << "Change Time" << "Owner" << "Permissions"; 1015 1015 m_pRootItem = new UIFileTableItem(headData, 0, FileObjectType_Directory); 1016 1016 QList<QVariant> startDirData; 1017 startDirData << startPath << 4096 << QDateTime() << "" ;1017 startDirData << startPath << 4096 << QDateTime() << "" << ""; 1018 1018 UIFileTableItem* startItem = new UIFileTableItem(startDirData, m_pRootItem, FileObjectType_Directory); 1019 1019 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.cpp
r71832 r71861 340 340 { 341 341 QVector<KDirectoryCopyFlag> aFlags(KDirectoryCopyFlag_CopyIntoExisting); 342 QString destinatioFilePath = UIPathOperations::addTrailingDelimiters(hostDestinationPath); 343 QString sourceWithDelimiter = UIPathOperations::addTrailingDelimiters(guestSourcePath); 344 342 345 /** @todo listen to CProgress object to monitor copy operation: */ 343 /*CProgress comProgress = */ m_comGuestSession.DirectoryCopyFromGuest(guestSourcePath, hostDestinationPath, aFlags); 346 /*CProgress comProgress = */ m_comGuestSession.DirectoryCopyFromGuest(guestSourcePath, hostDestinationPath/*destinatioFilePath*/ , aFlags); 347 m_comGuestSession.DirectoryCopyFromGuest(guestSourcePath, destinatioFilePath , aFlags); 348 m_comGuestSession.DirectoryCopyFromGuest(sourceWithDelimiter, destinatioFilePath , aFlags); 349 m_comGuestSession.DirectoryCopyFromGuest(sourceWithDelimiter, hostDestinationPath , aFlags); 350 344 351 } 345 352 if (!m_comGuestSession.isOk()) … … 375 382 /** @todo listen to CProgress object to monitor copy operation: */ 376 383 comProgress = m_comGuestSession.DirectoryCopyToGuest(hostSourcePath, destinationFilePath, aFlags); 377 378 379 384 } 380 385 /** @todo currently I cannot get an errorfrom CProgress: */ … … 392 397 return false; 393 398 } 394 399 /** @todo we have to until CProgress finishes to refresh: */ 400 refresh(); 395 401 return true; 396 402 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.h
r71832 r71861 58 58 bool copyGuestToHost(const QString &guestSourcePath, const QString& hostDestinationPath); 59 59 bool copyHostToGuest(const QString& hostSourcePath, const QString &guestDestinationPath); 60 61 60 mutable CGuestSession m_comGuestSession; 62 61 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.cpp
r71852 r71861 165 165 { 166 166 const QFileInfo &fileInfo = entries.at(i); 167 168 167 QList<QVariant> data; 169 168 data << fileInfo.fileName() << fileInfo.size() 170 << fileInfo.lastModified() << fileInfo.owner(); 169 << fileInfo.lastModified() << fileInfo.owner() << 170 permissionString(fileInfo.permissions()); 171 171 UIFileTableItem *item = new UIFileTableItem(data, parent, fileType(fileInfo)); 172 172 if (!item) … … 389 389 for (int i = 0; i < drive.size(); ++i) 390 390 { 391 m_driveLetterList.push_back(drive[i].filePath()); 391 if (UIPathOperations::doesPathStartWithDriveLetter(drive[i].filePath())) 392 m_driveLetterList.push_back(drive[i].filePath()); 392 393 393 394 } … … 395 396 } 396 397 398 QString UIHostFileTable::permissionString(QFileDevice::Permissions permissions) 399 { 400 QString strPermissions; 401 if (permissions & QFileDevice::ReadOwner) 402 strPermissions += 'r'; 403 else 404 strPermissions += '-'; 405 406 if (permissions & QFileDevice::WriteOwner) 407 strPermissions += 'w'; 408 else 409 strPermissions += '-'; 410 411 if (permissions & QFileDevice::ExeOwner) 412 strPermissions += 'x'; 413 else 414 strPermissions += '-'; 415 416 if (permissions & QFileDevice::ReadGroup) 417 strPermissions += 'r'; 418 else 419 strPermissions += '-'; 420 421 if (permissions & QFileDevice::WriteGroup) 422 strPermissions += 'w'; 423 else 424 strPermissions += '-'; 425 426 if (permissions & QFileDevice::ExeGroup) 427 strPermissions += 'x'; 428 else 429 strPermissions += '-'; 430 431 if (permissions & QFileDevice::ReadOther) 432 strPermissions += 'r'; 433 else 434 strPermissions += '-'; 435 436 if (permissions & QFileDevice::WriteOther) 437 strPermissions += 'w'; 438 else 439 strPermissions += '-'; 440 441 if (permissions & QFileDevice::ExeOther) 442 strPermissions += 'x'; 443 else 444 strPermissions += '-'; 445 446 447 448 449 450 return strPermissions; 451 } 452 397 453 #include "UIHostFileTable.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.h
r71832 r71861 48 48 49 49 void prepareActions(); 50 QString permissionString(QFileDevice::Permissions permissions); 50 51 }; 51 52
Note:
See TracChangeset
for help on using the changeset viewer.