Changeset 58370 in vbox for trunk/src/VBox/GuestHost
- Timestamp:
- Oct 22, 2015 10:34:26 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103586
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDDroppedFiles.cpp
r58212 r58370 35 35 36 36 DnDDroppedFiles::DnDDroppedFiles(void) 37 : hDir(NULL)38 , fOpen(0) { }39 40 DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, uint32_t f Open)41 : hDir(NULL)42 , fOpen(0)43 { 44 OpenEx(pszPath, f Open);37 : m_fOpen(0) 38 , m_hDir(NULL) { } 39 40 DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, uint32_t fFlags) 41 : m_fOpen(0) 42 , m_hDir(NULL) 43 { 44 OpenEx(pszPath, fFlags); 45 45 } 46 46 … … 56 56 AssertPtrReturn(pszFile, VERR_INVALID_POINTER); 57 57 58 if (!this-> lstFiles.contains(pszFile))59 this-> lstFiles.append(pszFile);58 if (!this->m_lstFiles.contains(pszFile)) 59 this->m_lstFiles.append(pszFile); 60 60 return VINF_SUCCESS; 61 61 } … … 65 65 AssertPtrReturn(pszDir, VERR_INVALID_POINTER); 66 66 67 if (!this-> lstDirs.contains(pszDir))68 this-> lstDirs.append(pszDir);67 if (!this->m_lstDirs.contains(pszDir)) 68 this->m_lstDirs.append(pszDir); 69 69 return VINF_SUCCESS; 70 70 } … … 73 73 { 74 74 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; 80 80 } 81 81 else … … 93 93 const char *DnDDroppedFiles::GetDirAbs(void) const 94 94 { 95 return this-> strPathAbs.c_str();95 return this->m_strPathAbs.c_str(); 96 96 } 97 97 98 98 bool DnDDroppedFiles::IsOpen(void) const 99 99 { 100 return (this-> hDir != NULL);100 return (this->m_hDir != NULL); 101 101 } 102 102 … … 156 156 if (RT_SUCCESS(rc)) 157 157 { 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; 161 161 } 162 162 } … … 196 196 else 197 197 { 198 this-> lstDirs.clear();199 this-> lstFiles.clear();198 this->m_lstDirs.clear(); 199 this->m_lstFiles.clear(); 200 200 } 201 201 } … … 207 207 int DnDDroppedFiles::Reopen(void) 208 208 { 209 if (this-> strPathAbs.isEmpty())209 if (this->m_strPathAbs.isEmpty()) 210 210 return VERR_NOT_FOUND; 211 211 212 return OpenEx(this-> strPathAbs.c_str(), this->fOpen);212 return OpenEx(this->m_strPathAbs.c_str(), this->m_fOpen); 213 213 } 214 214 215 215 int DnDDroppedFiles::Rollback(void) 216 216 { 217 if (this-> strPathAbs.isEmpty())217 if (this->m_strPathAbs.isEmpty()) 218 218 return VINF_SUCCESS; 219 219 … … 224 224 * anything recursive here! Steam (tm) knows best ... :-) */ 225 225 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()); 229 229 if (RT_SUCCESS(rc2)) 230 this-> lstFiles.removeAt(i);230 this->m_lstFiles.removeAt(i); 231 231 232 232 if (RT_SUCCESS(rc)) … … 235 235 } 236 236 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()); 240 240 if (RT_SUCCESS(rc2)) 241 this-> lstDirs.removeAt(i);241 this->m_lstDirs.removeAt(i); 242 242 243 243 if (RT_SUCCESS(rc)) … … 248 248 if (RT_SUCCESS(rc)) 249 249 { 250 Assert(this-> lstFiles.isEmpty());251 Assert(this-> lstDirs.isEmpty());250 Assert(this->m_lstFiles.isEmpty()); 251 Assert(this->m_lstDirs.isEmpty()); 252 252 253 253 rc2 = closeInternal(); … … 256 256 /* Try to remove the empty root dropped files directory as well. 257 257 * Might return VERR_DIR_NOT_EMPTY or similar. */ 258 rc2 = RTDirRemove(this-> strPathAbs.c_str());258 rc2 = RTDirRemove(this->m_strPathAbs.c_str()); 259 259 } 260 260 }
Note:
See TracChangeset
for help on using the changeset viewer.