VirtualBox

Changeset 58370 in vbox for trunk/src/VBox/GuestHost


Ignore:
Timestamp:
Oct 22, 2015 10:34:26 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103586
Message:

DnD: Warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDDroppedFiles.cpp

    r58212 r58370  
    3535
    3636DnDDroppedFiles::DnDDroppedFiles(void)
    37     : hDir(NULL)
    38     , fOpen(0) { }
    39 
    40 DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, uint32_t fOpen)
    41     : hDir(NULL)
    42     , fOpen(0)
    43 {
    44     OpenEx(pszPath, fOpen);
     37    : m_fOpen(0)
     38    , m_hDir(NULL) { }
     39
     40DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, uint32_t fFlags)
     41    : m_fOpen(0)
     42    , m_hDir(NULL)
     43{
     44    OpenEx(pszPath, fFlags);
    4545}
    4646
     
    5656    AssertPtrReturn(pszFile, VERR_INVALID_POINTER);
    5757
    58     if (!this->lstFiles.contains(pszFile))
    59         this->lstFiles.append(pszFile);
     58    if (!this->m_lstFiles.contains(pszFile))
     59        this->m_lstFiles.append(pszFile);
    6060    return VINF_SUCCESS;
    6161}
     
    6565    AssertPtrReturn(pszDir, VERR_INVALID_POINTER);
    6666
    67     if (!this->lstDirs.contains(pszDir))
    68         this->lstDirs.append(pszDir);
     67    if (!this->m_lstDirs.contains(pszDir))
     68        this->m_lstDirs.append(pszDir);
    6969    return VINF_SUCCESS;
    7070}
     
    7373{
    7474    int rc;
    75     if (this->hDir != NULL)
    76     {
    77         rc = RTDirClose(this->hDir);
    78         if (RT_SUCCESS(rc))
    79             this->hDir = NULL;
     75    if (this->m_hDir != NULL)
     76    {
     77        rc = RTDirClose(this->m_hDir);
     78        if (RT_SUCCESS(rc))
     79            this->m_hDir = NULL;
    8080    }
    8181    else
     
    9393const char *DnDDroppedFiles::GetDirAbs(void) const
    9494{
    95     return this->strPathAbs.c_str();
     95    return this->m_strPathAbs.c_str();
    9696}
    9797
    9898bool DnDDroppedFiles::IsOpen(void) const
    9999{
    100     return (this->hDir != NULL);
     100    return (this->m_hDir != NULL);
    101101}
    102102
     
    156156            if (RT_SUCCESS(rc))
    157157            {
    158                 this->hDir       = phDir;
    159                 this->strPathAbs = pszDropDir;
    160                 this->fOpen      = fFlags;
     158                this->m_hDir       = phDir;
     159                this->m_strPathAbs = pszDropDir;
     160                this->m_fOpen      = fFlags;
    161161            }
    162162        }
     
    196196        else
    197197        {
    198             this->lstDirs.clear();
    199             this->lstFiles.clear();
     198            this->m_lstDirs.clear();
     199            this->m_lstFiles.clear();
    200200        }
    201201    }
     
    207207int DnDDroppedFiles::Reopen(void)
    208208{
    209     if (this->strPathAbs.isEmpty())
     209    if (this->m_strPathAbs.isEmpty())
    210210        return VERR_NOT_FOUND;
    211211
    212     return OpenEx(this->strPathAbs.c_str(), this->fOpen);
     212    return OpenEx(this->m_strPathAbs.c_str(), this->m_fOpen);
    213213}
    214214
    215215int DnDDroppedFiles::Rollback(void)
    216216{
    217     if (this->strPathAbs.isEmpty())
     217    if (this->m_strPathAbs.isEmpty())
    218218        return VINF_SUCCESS;
    219219
     
    224224     *       anything recursive here! Steam (tm) knows best ... :-) */
    225225    int rc2;
    226     for (size_t i = 0; i < this->lstFiles.size(); i++)
    227     {
    228         rc2 = RTFileDelete(this->lstFiles.at(i).c_str());
     226    for (size_t i = 0; i < this->m_lstFiles.size(); i++)
     227    {
     228        rc2 = RTFileDelete(this->m_lstFiles.at(i).c_str());
    229229        if (RT_SUCCESS(rc2))
    230             this->lstFiles.removeAt(i);
     230            this->m_lstFiles.removeAt(i);
    231231
    232232        if (RT_SUCCESS(rc))
     
    235235    }
    236236
    237     for (size_t i = 0; i < this->lstDirs.size(); i++)
    238     {
    239         rc2 = RTDirRemove(this->lstDirs.at(i).c_str());
     237    for (size_t i = 0; i < this->m_lstDirs.size(); i++)
     238    {
     239        rc2 = RTDirRemove(this->m_lstDirs.at(i).c_str());
    240240        if (RT_SUCCESS(rc2))
    241             this->lstDirs.removeAt(i);
     241            this->m_lstDirs.removeAt(i);
    242242
    243243        if (RT_SUCCESS(rc))
     
    248248    if (RT_SUCCESS(rc))
    249249    {
    250         Assert(this->lstFiles.isEmpty());
    251         Assert(this->lstDirs.isEmpty());
     250        Assert(this->m_lstFiles.isEmpty());
     251        Assert(this->m_lstDirs.isEmpty());
    252252
    253253        rc2 = closeInternal();
     
    256256            /* Try to remove the empty root dropped files directory as well.
    257257             * Might return VERR_DIR_NOT_EMPTY or similar. */
    258             rc2 = RTDirRemove(this->strPathAbs.c_str());
     258            rc2 = RTDirRemove(this->m_strPathAbs.c_str());
    259259        }
    260260    }
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