- Timestamp:
- Oct 1, 2020 5:13:42 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDTransferList.cpp
r85746 r86370 250 250 if (pObj) 251 251 { 252 pObj = (PDNDTRANSFEROBJECT)RTMemAllocZ(sizeof(DNDTRANSFEROBJECT)); 253 if (pObj) 252 const bool fIsFile = RTFS_IS_FILE(fMode); 253 254 rc = DnDTransferObjectInitEx(pObj, fIsFile ? DNDTRANSFEROBJTYPE_FILE : DNDTRANSFEROBJTYPE_DIRECTORY, 255 pList->pszPathRootAbs, &pcszSrcAbs[idxPathToAdd]); 256 if (RT_SUCCESS(rc)) 254 257 { 255 const bool fIsFile = RTFS_IS_FILE(fMode);256 257 rc = DnDTransferObjectInitEx(pObj, fIsFile ? DNDTRANSFEROBJTYPE_FILE : DNDTRANSFEROBJTYPE_DIRECTORY,258 pList->pszPathRootAbs, &pcszSrcAbs[idxPathToAdd]);258 if (fIsFile) 259 rc = DnDTransferObjectOpen(pObj, 260 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, /** @todo Add a standard fOpen mode for this list. */ 261 0 /* fMode */, DNDTRANSFEROBJECT_FLAGS_NONE); 259 262 if (RT_SUCCESS(rc)) 260 263 { 264 RTListAppend(&pList->lstObj, &pObj->Node); 265 266 pList->cObj++; 261 267 if (fIsFile) 262 rc = DnDTransferObjectOpen(pObj, 263 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, /** @todo Add a standard fOpen mode for this list. */ 264 0 /* fMode */, DNDTRANSFEROBJECT_FLAGS_NONE); 265 if (RT_SUCCESS(rc)) 266 { 267 RTListAppend(&pList->lstObj, &pObj->Node); 268 269 pList->cObj++; 270 if (fIsFile) 271 pList->cbObjTotal += DnDTransferObjectGetSize(pObj); 272 273 if ( fIsFile 274 && !(fFlags & DNDTRANSFERLIST_FLAGS_KEEP_OPEN)) /* Shall we keep the file open while being added to this list? */ 275 DnDTransferObjectClose(pObj); 276 } 277 278 if (RT_FAILURE(rc)) 279 DnDTransferObjectDestroy(pObj); 268 pList->cbObjTotal += DnDTransferObjectGetSize(pObj); 269 270 if ( fIsFile 271 && !(fFlags & DNDTRANSFERLIST_FLAGS_KEEP_OPEN)) /* Shall we keep the file open while being added to this list? */ 272 DnDTransferObjectClose(pObj); 280 273 } 274 275 if (RT_FAILURE(rc)) 276 DnDTransferObjectDestroy(pObj); 281 277 } 282 else283 rc = VERR_NO_MEMORY;284 278 285 279 if (RT_FAILURE(rc))
Note:
See TracChangeset
for help on using the changeset viewer.