- 時間撮記:
- 2016-2-26 下午03:38:01 (9 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
r58329 r59852 5 5 6 6 /* 7 * Copyright (C) 2014-201 5Oracle Corporation7 * Copyright (C) 2014-2016 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 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 { 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 69 72 if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */ 70 73 { 71 74 /** @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); 75 rc = pObj->Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 76 objInfo.Attr.fMode); 73 77 } 74 78 75 79 if (RT_SUCCESS(rc)) 76 80 { 77 m_lstTree.append(pObj File);81 m_lstTree.append(pObj); 78 82 79 83 m_cTotal++; 80 m_cbTotal += pObj File->GetSize();84 m_cbTotal += pObj->GetSize(); 81 85 } 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); 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); 97 93 98 94 /** @todo Add DNDURILIST_FLAGS_KEEP_OPEN handling? */ 99 95 m_cTotal++; 100 96 } 97 /* Note: Symlinks already should have been resolved at this point. */ 101 98 else 102 rc = VERR_NO_MEMORY; 103 } 104 /* Note: Symlinks already should have been resolved at this point. */ 105 else 106 rc = VERR_NOT_SUPPORTED; 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 } 107 111 } 108 112
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器