VirtualBox

Ignore:
Timestamp:
Feb 12, 2019 3:51:01 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128802
Message:

FE/Qt: Guest Control file manager: Yet another fix for copying directories; follow-up fix for r128495.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.cpp

    r77050 r77286  
    186186}
    187187
    188 QString UICustomFileSystemItem::path() const
    189 {
    190     return UIPathOperations::removeTrailingDelimiters(m_itemData.value(UICustomFileSystemModelColumn_Path, QString()).toString());
     188QString UICustomFileSystemItem::path(bool fRemoveTrailingDelimiters /* = false */) const
     189{
     190    const QString &strPath = m_itemData.value(UICustomFileSystemModelColumn_Path, QString()).toString();
     191
     192    if (fRemoveTrailingDelimiters)
     193        return UIPathOperations::removeTrailingDelimiters(strPath);
     194
     195    return strPath;
    191196}
    192197
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.h

    r76750 r77286  
    7676    void setIsOpened(bool flag);
    7777
    78     /** Full absolute path of the item. Without the trailing '/' */
    79     QString  path() const;
     78    /** Full absolute path of the item. With or without the trailing '/' */
     79    QString  path(bool fRemoveTrailingDelimiters = false) const;
    8080    void setPath(const QString &path);
    8181
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp

    r76671 r77286  
    10851085        if (!item)
    10861086            continue;
    1087         pathList.push_back(item->path());
     1087
     1088        /* Make sure to remove any trailing delimiters for directory paths here (e.g. "C:\foo\bar\" -> "C:\foo\bar"),
     1089         * as we want to copy entire directories, not only its contents (see Guest Control SDK docs). */
     1090        pathList.push_back(item->path(true /* fRemoveTrailingDelimiters */));
    10881091    }
    10891092    return pathList;
Note: See TracChangeset for help on using the changeset viewer.

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