Changeset 75941 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Dec 4, 2018 10:49:47 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 127150
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestFileTable.cpp
r75932 r75941 200 200 { 201 201 QVector<QVariant> data; 202 QDateTime changeTime = QDateTime::fromMSecsSinceEpoch(fsInfo.GetChangeTime()/ 1000000);202 QDateTime changeTime = QDateTime::fromMSecsSinceEpoch(fsInfo.GetChangeTime()/RT_NS_1MS); 203 203 204 204 data << fsInfo.GetName() << static_cast<qulonglong>(fsInfo.GetObjectSize()) 205 << changeTime << fsInfo.GetUserName(); 205 << changeTime << fsInfo.GetUserName() << permissionString(fsInfo); 206 206 207 FileObjectType fsObjectType = fileType(fsInfo); 207 208 UIFileTableItem *item = new UIFileTableItem(data, parent, fsObjectType); 209 208 210 if (!item) 209 211 continue; … … 219 221 item->setIsOpened(false); 220 222 } 221 /** @todo Seems like our API is not able to detect symlinks: */222 223 else if(fsObjectType == FileObjectType_SymLink) 223 224 { 224 225 files.insert(fsInfo.GetName(), item); 225 226 item->setIsOpened(false); 227 /* @todo. We will need to wait a fully implemented SymlinkRead function 228 * to be able to handle sym links properly: */ 229 // QString path = UIPathOperations::mergePaths(strPath, fsInfo.GetName()); 230 // QVector<KSymlinkReadFlag> aFlags; 231 // printf("%s %s %s\n", qPrintable(fsInfo.GetName()), qPrintable(path), 232 // qPrintable(m_comGuestSession.SymlinkRead(path, aFlags))); 226 233 } 227 234 … … 438 445 LONG64 size = fileInfo.GetObjectSize(); 439 446 propertyStringList << UIGuestControlFileManager::tr("<b>Size:</b> %1 bytes").arg(QString::number(size)); 440 if (size >= 1024)447 if (size >= UIGuestControlFileTable::m_iKiloByte) 441 448 propertyStringList << QString(" (%1)<br/>").arg(humanReadableSize(size)); 442 449 else … … 446 453 size = fileInfo.GetAllocatedSize(); 447 454 propertyStringList << UIGuestControlFileManager::tr("<b>Allocated:</b> %1 bytes").arg(QString::number(size)); 448 if (size >= 1024)455 if (size >= UIGuestControlFileTable::m_iKiloByte) 449 456 propertyStringList << QString(" (%1)<br/>").arg(humanReadableSize(size)); 450 457 else … … 731 738 return true; 732 739 } 740 741 QString UIGuestFileTable::permissionString(const CFsObjInfo &fsInfo) 742 { 743 /* Attributes: */ 744 QString strAttributes = fsInfo.GetFileAttributes(); 745 746 if (strAttributes.isEmpty()) 747 return strAttributes; 748 749 int offSpace = strAttributes.indexOf(' '); 750 if (offSpace < 0) 751 offSpace = strAttributes.length(); 752 return strAttributes.left(offSpace); 753 } 754 733 755 #include "UIGuestFileTable.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestFileTable.h
r75903 r75941 78 78 void prepareActionConnections(); 79 79 bool checkGuestSession(); 80 80 QString permissionString(const CFsObjInfo &fsInfo); 81 81 mutable CGuestSession m_comGuestSession; 82 82 };
Note:
See TracChangeset
for help on using the changeset viewer.