Changeset 74526 in vbox for trunk/src/VBox/GuestHost/DragAndDrop
- Timestamp:
- Sep 28, 2018 3:08:24 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 125394
- Location:
- trunk/src/VBox/GuestHost/DragAndDrop
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDDroppedFiles.cpp
r69753 r74526 5 5 6 6 /* 7 * Copyright (C) 2014-201 7Oracle Corporation7 * Copyright (C) 2014-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 38 38 , m_hDir(NULL) { } 39 39 40 DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, uint32_t fFlags)40 DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */) 41 41 : m_fOpen(0) 42 42 , m_hDir(NULL) … … 101 101 } 102 102 103 int DnDDroppedFiles::OpenEx(const char *pszPath, uint32_t fFlags)103 int DnDDroppedFiles::OpenEx(const char *pszPath, DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */) 104 104 { 105 105 AssertPtrReturn(pszPath, VERR_INVALID_POINTER); … … 168 168 } 169 169 170 int DnDDroppedFiles::OpenTemp( uint32_t fFlags)170 int DnDDroppedFiles::OpenTemp(DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */) 171 171 { 172 172 AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER); /* Flags not supported yet. */ -
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
r69758 r74526 5 5 6 6 /* 7 * Copyright (C) 2014-201 7Oracle Corporation7 * Copyright (C) 2014-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 48 48 } 49 49 50 int DnDURIList::addEntry(const char *pcszSource, const char *pcszTarget, uint32_tfFlags)50 int DnDURIList::addEntry(const char *pcszSource, const char *pcszTarget, DNDURILISTFLAGS fFlags) 51 51 { 52 52 AssertPtrReturn(pcszSource, VERR_INVALID_POINTER); … … 64 64 pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode)); 65 65 66 DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject:: File, pcszSource, pcszTarget);66 DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::Type_File, pcszSource, pcszTarget); 67 67 if (pObjFile) 68 68 { … … 70 70 { 71 71 /** @todo Add a standard fOpen mode for this list. */ 72 rc = pObjFile->Open(DnDURIObject:: Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode);72 rc = pObjFile->Open(DnDURIObject::View_Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode); 73 73 } 74 74 … … 90 90 LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode)); 91 91 92 DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject:: Directory, pcszSource, pcszTarget,92 DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Type_Directory, pcszSource, pcszTarget, 93 93 objInfo.Attr.fMode, 0 /* Size */); 94 94 if (pObjDir) … … 112 112 113 113 int DnDURIList::appendPathRecursive(const char *pcszSrcPath, 114 const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase, uint32_t fFlags) 114 const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase, 115 DNDURILISTFLAGS fFlags) 115 116 { 116 117 AssertPtrReturn(pcszSrcPath, VERR_INVALID_POINTER); … … 118 119 AssertPtrReturn(pcszDstPath, VERR_INVALID_POINTER); 119 120 120 LogFlowFunc(("pcszSrcPath=%s, pcszDstPath=%s, pcszDstBase=%s, cchDstBase=%zu \n",121 pcszSrcPath, pcszDstPath, pcszDstBase, cchDstBase ));121 LogFlowFunc(("pcszSrcPath=%s, pcszDstPath=%s, pcszDstBase=%s, cchDstBase=%zu, fFlags=0x%x\n", 122 pcszSrcPath, pcszDstPath, pcszDstBase, cchDstBase, fFlags)); 122 123 123 124 RTFSOBJINFO objInfo; … … 278 279 } 279 280 280 int DnDURIList::AppendNativePath(const char *pszPath, uint32_tfFlags)281 int DnDURIList::AppendNativePath(const char *pszPath, DNDURILISTFLAGS fFlags) 281 282 { 282 283 AssertPtrReturn(pszPath, VERR_INVALID_POINTER); … … 307 308 308 309 int DnDURIList::AppendNativePathsFromList(const char *pszNativePaths, size_t cbNativePaths, 309 uint32_tfFlags)310 DNDURILISTFLAGS fFlags) 310 311 { 311 312 AssertPtrReturn(pszNativePaths, VERR_INVALID_POINTER); … … 318 319 319 320 int DnDURIList::AppendNativePathsFromList(const RTCList<RTCString> &lstNativePaths, 320 uint32_tfFlags)321 DNDURILISTFLAGS fFlags) 321 322 { 322 323 int rc = VINF_SUCCESS; … … 334 335 } 335 336 336 int DnDURIList::AppendURIPath(const char *pszURI, uint32_tfFlags)337 int DnDURIList::AppendURIPath(const char *pszURI, DNDURILISTFLAGS fFlags) 337 338 { 338 339 AssertPtrReturn(pszURI, VERR_INVALID_POINTER); … … 385 386 386 387 int DnDURIList::AppendURIPathsFromList(const char *pszURIPaths, size_t cbURIPaths, 387 uint32_tfFlags)388 DNDURILISTFLAGS fFlags) 388 389 { 389 390 AssertPtrReturn(pszURIPaths, VERR_INVALID_POINTER); … … 396 397 397 398 int DnDURIList::AppendURIPathsFromList(const RTCList<RTCString> &lstURI, 398 uint32_tfFlags)399 DNDURILISTFLAGS fFlags) 399 400 { 400 401 int rc = VINF_SUCCESS; … … 447 448 } 448 449 449 int DnDURIList:: RootFromURIData(const void *pvData, size_t cbData, uint32_tfFlags)450 int DnDURIList::SetFromURIData(const void *pvData, size_t cbData, DNDURILISTFLAGS fFlags) 450 451 { 451 452 Assert(fFlags == 0); RT_NOREF1(fFlags); … … 493 494 } 494 495 495 RTCString DnDURIList:: RootToString(const RTCString &strPathBase /* = "" */,496 RTCString DnDURIList::GetRootEntries(const RTCString &strPathBase /* = "" */, 496 497 const RTCString &strSeparator /* = "\r\n" */) const 497 498 { -
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
r69500 r74526 6 6 7 7 /* 8 * Copyright (C) 2014-201 7Oracle Corporation8 * Copyright (C) 2014-2018 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 37 37 38 38 DnDURIObject::DnDURIObject(void) 39 : m_Type( Unknown)39 : m_Type(Type_Unknown) 40 40 , m_fOpen(false) 41 41 , m_fMode(0) … … 46 46 } 47 47 48 DnDURIObject::DnDURIObject(Type type,48 DnDURIObject::DnDURIObject(Type enmType, 49 49 const RTCString &strSrcPath /* = 0 */, 50 50 const RTCString &strDstPath /* = 0 */, 51 51 uint32_t fMode /* = 0 */, uint64_t cbSize /* = 0 */) 52 : m_Type( type)52 : m_Type(enmType) 53 53 , m_strSrcPath(strSrcPath) 54 54 , m_strTgtPath(strDstPath) … … 74 74 switch (m_Type) 75 75 { 76 case File:76 case Type_File: 77 77 { 78 78 RTFileClose(u.m_hFile); … … 81 81 } 82 82 83 case Directory:83 case Type_Directory: 84 84 break; 85 85 … … 102 102 switch (m_Type) 103 103 { 104 case File:104 case Type_File: 105 105 Assert(m_cbProcessed <= m_cbSize); 106 106 fComplete = m_cbProcessed == m_cbSize; 107 107 break; 108 108 109 case Directory:109 case Type_Directory: 110 110 fComplete = true; 111 111 break; … … 124 124 } 125 125 126 int DnDURIObject::Open( Dest enmDest, uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */)127 { 128 return OpenEx( enm Dest ==Source126 int DnDURIObject::Open(View enmView, uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */) 127 { 128 return OpenEx( enmView == View_Source 129 129 ? m_strSrcPath : m_strTgtPath 130 , m_Type, enm Dest, fOpen, fMode, 0 /* fFlags */);131 } 132 133 int DnDURIObject::OpenEx(const RTCString &strPath, Type enmType, Dest enmDest,134 uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */, uint32_t fFlags /* = 0*/)130 , m_Type, enmView, fOpen, fMode, 0 /* fFlags */); 131 } 132 133 int DnDURIObject::OpenEx(const RTCString &strPath, Type enmType, View enmView, 134 uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */, DNDURIOBJECTFLAGS fFlags /* = DNDURIOBJECT_FLAGS_NONE */) 135 135 { 136 136 Assert(fFlags == 0); RT_NOREF1(fFlags); 137 137 int rc = VINF_SUCCESS; 138 138 139 switch (enm Dest)140 { 141 case Source:139 switch (enmView) 140 { 141 case View_Source: 142 142 m_strSrcPath = strPath; 143 143 break; 144 144 145 case Target:145 case View_Target: 146 146 m_strTgtPath = strPath; 147 147 break; … … 155 155 && fOpen) /* Opening mode specified? */ 156 156 { 157 LogFlowThisFunc((" enmType=%RU32, strPath=%s, fOpen=0x%x, enmType=%RU32, enmDest=%RU32\n",158 enmType, strPath.c_str(), fOpen, enmType, enmDest));157 LogFlowThisFunc(("strPath=%s, enmType=%RU32, enmView=%RU32, fOpen=0x%x, fMode=0x%x, fFlags=0x%x\n", 158 strPath.c_str(), enmType, enmView, fOpen, fFlags)); 159 159 switch (enmType) 160 160 { 161 case File:161 case Type_File: 162 162 { 163 163 if (!m_fOpen) … … 207 207 } 208 208 209 case Directory:209 case Type_Directory: 210 210 rc = VINF_SUCCESS; 211 211 break; … … 294 294 switch (m_Type) 295 295 { 296 case File:297 { 298 rc = OpenEx(m_strSrcPath, File,Source,296 case Type_File: 297 { 298 rc = OpenEx(m_strSrcPath, Type_File, View_Source, 299 299 /* Use some sensible defaults. */ 300 300 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 0 /* fFlags */); … … 319 319 } 320 320 321 case Directory:321 case Type_Directory: 322 322 { 323 323 rc = VINF_SUCCESS; … … 346 346 Close(); 347 347 348 m_Type = Unknown;348 m_Type = Type_Unknown; 349 349 m_strSrcPath = ""; 350 350 m_strTgtPath = ""; … … 365 365 switch (m_Type) 366 366 { 367 case File:368 { 369 rc = OpenEx(m_strTgtPath, File,Target,367 case Type_File: 368 { 369 rc = OpenEx(m_strTgtPath, Type_File, View_Target, 370 370 /* Use some sensible defaults. */ 371 371 RTFILE_O_OPEN_CREATE | RTFILE_O_DENY_WRITE | RTFILE_O_WRITE, 0 /* fFlags */); … … 379 379 } 380 380 381 case Directory:381 case Type_Directory: 382 382 { 383 383 rc = VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.