VirtualBox

Changeset 71654 in vbox for trunk/src


Ignore:
Timestamp:
Apr 4, 2018 1:26:06 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699 Some corrections to file copying stuff

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.h

    r71645 r71654  
    129129
    130130#endif /* !___UIGuestControlFileManager_h___ */
     131
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp

    r71645 r71654  
    187187        return QString();
    188188    QString newPath(path);
    189     /* Make sure for we dont have any trailing slashes: */
     189    /* Make sure for we dont have any trailing delimiters: */
    190190    while (newPath.length() > 1 && newPath.at(newPath.length() - 1) == UIPathOperations::delimiter)
    191191        newPath.chop(1);
     192    return newPath;
     193}
     194
     195/* static */ QString UIPathOperations::addTrailingDelimiters
     196(const QString &path)
     197{
     198    if (path.isNull() || path.isEmpty())
     199        return QString();
     200    QString newPath(path);
     201    while (newPath.length() > 1 && newPath.at(newPath.length() - 1) != UIPathOperations::delimiter)
     202        newPath += UIPathOperations::delimiter;
    192203    return newPath;
    193204}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h

    r71645 r71654  
    133133    static QString removeMultipleDelimiters(const QString &path);
    134134    static QString removeTrailingDelimiters(const QString &path);
     135    static QString addTrailingDelimiters(const QString &path);
    135136    static QString addStartDelimiter(const QString &path);
    136137
     
    334335
    335336#endif /* !___UIGuestControlFileTable_h___ */
     337
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.cpp

    r71645 r71654  
    347347    {
    348348        QVector<KFileCopyFlag> flags(KFileCopyFlag_FollowLinks);
    349         /* API expects a full file path as destionation: */
    350         QString destinationFilePath =  UIPathOperations::mergePaths(guestDestinationPath, UIPathOperations::getObjectName(hostSourcePath));
     349        QString destinationFilePath =  UIPathOperations::addTrailingDelimiters(guestDestinationPath);
    351350        /** @todo listen to CProgress object to monitor copy operation: */
    352         /*CProgress comProgress =*/ m_comGuestSession.FileCopyToGuest(hostSourcePath, destinationFilePath, flags);
     351        /*CProgress comProgress =*/ m_comGuestSession.FileCopyToGuest(hostSourcePath, "/home/vbox/temp/", flags);
    353352    }
    354353    else if(hostFileInfo.isDir())
    355354    {
    356         QVector<KDirectoryCopyFlag> aFlags(KDirectoryCopyFlag_None/*CopyIntoExisting*/);
     355
     356        QVector<KDirectoryCopyFlag> aFlags(KDirectoryCopyFlag_CopyIntoExisting);
    357357        /** @todo listen to CProgress object to monitor copy operation: */
    358358        /*CProgress comProgress = */ m_comGuestSession.DirectoryCopyToGuest(hostSourcePath, guestDestinationPath, aFlags);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.h

    r71645 r71654  
    6363
    6464#endif /* !___UIGuestControlFileTable_h___ */
     65
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