equal
deleted
inserted
replaced
109 // destructor |
109 // destructor |
110 // ----------------------------------------------------------------------------- |
110 // ----------------------------------------------------------------------------- |
111 // |
111 // |
112 FileDataItem::~FileDataItem() |
112 FileDataItem::~FileDataItem() |
113 { |
113 { |
114 if(m_fileLocked) { |
114 if(m_fileLocked && m_fileSize > 0 ) { |
115 m_file.UnLock(0, m_fileSize); |
115 m_file.UnLock(0, m_fileSize); |
116 } |
116 } |
117 m_file.Close(); |
117 m_file.Close(); |
118 } |
118 } |
119 |
119 |
130 RFs rfs = StaticObjectsContainer::instance()->fsSession(); |
130 RFs rfs = StaticObjectsContainer::instance()->fsSession(); |
131 HBufC* fileName = formDataElement->m_filename.des().AllocLC(); |
131 HBufC* fileName = formDataElement->m_filename.des().AllocLC(); |
132 // size of the file |
132 // size of the file |
133 User::LeaveIfError(m_file.Open(rfs, fileName->Des(), EFileRead | EFileShareReadersOnly)); |
133 User::LeaveIfError(m_file.Open(rfs, fileName->Des(), EFileRead | EFileShareReadersOnly)); |
134 User::LeaveIfError(m_file.Size(m_fileSize)); |
134 User::LeaveIfError(m_file.Size(m_fileSize)); |
|
135 if (m_fileSize > 0) |
|
136 { |
135 User::LeaveIfError(m_file.Lock(0, m_fileSize)); |
137 User::LeaveIfError(m_file.Lock(0, m_fileSize)); |
136 m_fileLocked = ETrue; |
138 m_fileLocked = ETrue; |
|
139 } |
137 CleanupStack::PopAndDestroy();// fileName |
140 CleanupStack::PopAndDestroy();// fileName |
138 } |
141 } |
139 |
142 |
140 |
143 |
141 // ----------------------------------------------------------------------------- |
144 // ----------------------------------------------------------------------------- |