VirtualBox

Changeset 55640 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
May 4, 2015 12:38:57 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
100015
Message:

DnD:

  • Overhauled "dropped files" directory + general file handling: Keep the directories/files open when doing the actual transfers (only protocol >= 2)
  • Unified "dropped files" directory creation/rollback handling for guest/host parts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestDnDPrivate.h

    r55571 r55640  
    106106    void Reset(void)
    107107    {
    108         strDropDir = "";
    109108        lstURI.Clear();
    110         lstDirs.clear();
    111         lstFiles.clear();
    112109#if 0 /* Currently the scratch buffer will be maintained elswewhere. */
    113110        if (pvScratchBuf)
     
    123120    }
    124121
    125     int Rollback(void)
    126     {
    127         if (strDropDir.isEmpty())
    128             return VINF_SUCCESS;
    129 
    130         int rc = VINF_SUCCESS;
    131         int rc2;
    132 
    133         /* Rollback by removing any stuff created.
    134          * Note: Only remove empty directories, never ever delete
    135          *       anything recursive here! Steam (tm) knows best ... :-) */
    136         for (size_t i = 0; i < lstFiles.size(); i++)
    137         {
    138             rc2 = RTFileDelete(lstFiles.at(i).c_str());
    139             if (RT_SUCCESS(rc))
    140                 rc = rc2;
    141         }
    142 
    143         for (size_t i = 0; i < lstDirs.size(); i++)
    144         {
    145             rc2 = RTDirRemove(lstDirs.at(i).c_str());
    146             if (RT_SUCCESS(rc))
    147                 rc = rc2;
    148         }
    149 
    150         rc2 = RTDirRemove(strDropDir.c_str());
    151         if (RT_SUCCESS(rc))
    152             rc = rc2;
    153 
    154         return rc;
    155     }
    156 
    157     /** Temporary drop directory on the host where to
    158      *  put the files sent from the guest. */
    159     com::Utf8Str                    strDropDir;
     122    DNDDIRDROPPEDFILES              mDropDir;
    160123    /** (Non-recursive) List of root URI objects to receive. */
    161124    DnDURIList                      lstURI;
    162125    /** Current object to receive. */
    163126    DnDURIObject                    objURI;
    164     /** List for holding created directories in the case of a rollback. */
    165     RTCList<RTCString>              lstDirs;
    166     /** List for holding created files in the case of a rollback. */
    167     RTCList<RTCString>              lstFiles;
    168127    /** Pointer to an optional scratch buffer to use for
    169128     *  doing the actual chunk transfers. */
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