VirtualBox

Changeset 71861 in vbox for trunk


Ignore:
Timestamp:
Apr 13, 2018 2:11:11 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:66099 Add 'permissions' column to the file manager

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  
    10121012    const QString startPath("/");
    10131013    QList<QVariant> headData;
    1014     headData << "Name" << "Size" << "Change Time" << "Owner";
     1014    headData << "Name" << "Size" << "Change Time" << "Owner" << "Permissions";
    10151015    m_pRootItem = new UIFileTableItem(headData, 0, FileObjectType_Directory);
    10161016    QList<QVariant> startDirData;
    1017     startDirData << startPath << 4096 << QDateTime() << "";
     1017    startDirData << startPath << 4096 << QDateTime() << "" << "";
    10181018    UIFileTableItem* startItem = new UIFileTableItem(startDirData, m_pRootItem, FileObjectType_Directory);
    10191019
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.cpp

    r71832 r71861  
    340340    {
    341341        QVector<KDirectoryCopyFlag> aFlags(KDirectoryCopyFlag_CopyIntoExisting);
     342        QString destinatioFilePath =  UIPathOperations::addTrailingDelimiters(hostDestinationPath);
     343        QString sourceWithDelimiter =  UIPathOperations::addTrailingDelimiters(guestSourcePath);
     344
    342345        /** @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
    344351    }
    345352    if (!m_comGuestSession.isOk())
     
    375382        /** @todo listen to CProgress object to monitor copy operation: */
    376383        comProgress = m_comGuestSession.DirectoryCopyToGuest(hostSourcePath, destinationFilePath, aFlags);
    377 
    378 
    379384    }
    380385    /** @todo currently I cannot get an errorfrom CProgress: */
     
    392397        return false;
    393398    }
    394 
     399    /** @todo we have to until CProgress finishes to refresh: */
     400    refresh();
    395401    return true;
    396402}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.h

    r71832 r71861  
    5858    bool copyGuestToHost(const QString &guestSourcePath, const QString& hostDestinationPath);
    5959    bool copyHostToGuest(const QString& hostSourcePath, const QString &guestDestinationPath);
    60 
    6160    mutable CGuestSession m_comGuestSession;
    6261
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.cpp

    r71852 r71861  
    165165    {
    166166        const QFileInfo &fileInfo = entries.at(i);
    167 
    168167        QList<QVariant> data;
    169168        data << fileInfo.fileName() << fileInfo.size()
    170              << fileInfo.lastModified() << fileInfo.owner();
     169             << fileInfo.lastModified() << fileInfo.owner() <<
     170            permissionString(fileInfo.permissions());
    171171        UIFileTableItem *item = new UIFileTableItem(data, parent, fileType(fileInfo));
    172172        if (!item)
     
    389389    for (int i = 0; i < drive.size(); ++i)
    390390    {
    391         m_driveLetterList.push_back(drive[i].filePath());
     391        if (UIPathOperations::doesPathStartWithDriveLetter(drive[i].filePath()))
     392            m_driveLetterList.push_back(drive[i].filePath());
    392393
    393394    }
     
    395396}
    396397
     398QString 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
    397453#include "UIHostFileTable.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.h

    r71832 r71861  
    4848
    4949    void prepareActions();
     50    QString permissionString(QFileDevice::Permissions permissions);
    5051};
    5152
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette