Changeset 59854 in vbox for trunk/src/VBox/GuestHost
- Timestamp:
- Feb 26, 2016 3:41:01 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
r59852 r59854 5 5 6 6 /* 7 * Copyright (C) 2014-201 6Oracle Corporation7 * Copyright (C) 2014-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 59 59 if (RT_SUCCESS(rc)) 60 60 { 61 try 62 { 63 DnDURIObject *pObj = NULL; 64 65 if (RTFS_IS_FILE(objInfo.Attr.fMode)) 66 { 67 LogFlowFunc(("File '%s' -> '%s' (%RU64 bytes, file mode 0x%x)\n", 68 pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode)); 69 70 pObj = new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget); 71 61 if (RTFS_IS_FILE(objInfo.Attr.fMode)) 62 { 63 LogFlowFunc(("File '%s' -> '%s' (%RU64 bytes, file mode 0x%x)\n", 64 pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode)); 65 66 DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget); 67 if (pObjFile) 68 { 72 69 if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */ 73 70 { 74 71 /** @todo Add a standard fOpen mode for this list. */ 75 rc = pObj->Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 76 objInfo.Attr.fMode); 72 rc = pObjFile->Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode); 77 73 } 78 74 79 75 if (RT_SUCCESS(rc)) 80 76 { 81 m_lstTree.append(pObj );77 m_lstTree.append(pObjFile); 82 78 83 79 m_cTotal++; 84 m_cbTotal += pObj ->GetSize();80 m_cbTotal += pObjFile->GetSize(); 85 81 } 86 } 87 else if (RTFS_IS_DIRECTORY(objInfo.Attr.fMode)) 88 { 89 LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode)); 90 91 pObj = new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget, objInfo.Attr.fMode, 0 /* Size */); 92 m_lstTree.append(pObj); 82 else 83 delete pObjFile; 84 } 85 else 86 rc = VERR_NO_MEMORY; 87 } 88 else if (RTFS_IS_DIRECTORY(objInfo.Attr.fMode)) 89 { 90 LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode)); 91 92 DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget, 93 objInfo.Attr.fMode, 0 /* Size */); 94 if (pObjDir) 95 { 96 m_lstTree.append(pObjDir); 93 97 94 98 /** @todo Add DNDURILIST_FLAGS_KEEP_OPEN handling? */ 95 99 m_cTotal++; 96 100 } 97 /* Note: Symlinks already should have been resolved at this point. */98 101 else 99 rc = VERR_NOT_SUPPORTED; 100 101 if (RT_FAILURE(rc)) 102 { 103 if (pObj) 104 delete pObj; 105 } 106 } 107 catch (std::bad_alloc &) 108 { 109 rc = VERR_NO_MEMORY; 110 } 102 rc = VERR_NO_MEMORY; 103 } 104 /* Note: Symlinks already should have been resolved at this point. */ 105 else 106 rc = VERR_NOT_SUPPORTED; 111 107 } 112 108
Note:
See TracChangeset
for help on using the changeset viewer.