Changeset 59828 in vbox for trunk/src/VBox/GuestHost/DragAndDrop
- Timestamp:
- Feb 26, 2016 9:51:24 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
r59778 r59828 53 53 , m_strTgtPath(strDstPath) 54 54 , m_fMode(fMode) 55 , m_fOpen(false) 55 56 , m_cbSize(cbSize) 56 57 , m_cbProcessed(0) 57 58 { 59 } 60 61 DnDURIObject::~DnDURIObject(void) 62 { 63 closeInternal(); 64 } 65 66 void DnDURIObject::closeInternal(void) 67 { 68 LogFlowThisFuncEnter(); 69 70 if (!m_fOpen) 71 return; 72 58 73 switch (m_Type) 59 74 { 60 75 case File: 76 { 77 RTFileClose(u.m_hFile); 61 78 u.m_hFile = NIL_RTFILE; 62 79 break; 80 } 63 81 64 82 case Directory: … … 68 86 break; 69 87 } 70 } 71 72 DnDURIObject::~DnDURIObject(void) 73 { 74 closeInternal(); 75 } 76 77 void DnDURIObject::closeInternal(void) 78 { 79 LogFlowThisFuncEnter(); 80 switch (m_Type) 81 { 82 case File: 83 { 84 if (u.m_hFile != NIL_RTFILE) 85 { 86 int rc2 = RTFileClose(u.m_hFile); 87 AssertRC(rc2); 88 89 u.m_hFile = NIL_RTFILE; 90 } 91 break; 92 } 93 94 case Directory: 95 break; 96 97 default: 98 break; 99 } 88 89 m_fOpen = false; 100 90 } 101 91 … … 130 120 bool DnDURIObject::IsOpen(void) const 131 121 { 132 bool fIsOpen; 133 134 switch (m_Type) 135 { 136 case File: 137 fIsOpen = u.m_hFile != NIL_RTFILE; 138 break; 139 140 case Directory: 141 fIsOpen = true; 142 break; 143 144 default: 145 fIsOpen = false; 146 break; 147 } 148 149 return fIsOpen; 122 return m_fOpen; 150 123 } 151 124 … … 180 153 && fOpen) /* Opening mode specified? */ 181 154 { 182 LogFlowThisFunc((" strPath=%s, fOpen=0x%x, enmType=%RU32, enmDest=%RU32\n",183 strPath.c_str(), fOpen, enmType, enmDest));155 LogFlowThisFunc(("enmType=%RU32, strPath=%s, fOpen=0x%x, enmType=%RU32, enmDest=%RU32\n", 156 enmType, strPath.c_str(), fOpen, enmType, enmDest)); 184 157 switch (enmType) 185 158 { 186 159 case File: 187 160 { 188 if ( u.m_hFile == NIL_RTFILE)161 if (!m_fOpen) 189 162 { 190 163 /* … … 243 216 244 217 if (RT_SUCCESS(rc)) 245 m_Type = enmType; 218 { 219 m_Type = enmType; 220 m_fOpen = true; 221 } 246 222 247 223 LogFlowFuncLeaveRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.