85 // ---------------------------------------------------------------------------- |
85 // ---------------------------------------------------------------------------- |
86 // ---------------------------------------------------------------------------- |
86 // ---------------------------------------------------------------------------- |
87 CIpsPlgImap4MoveRemoteOp::~CIpsPlgImap4MoveRemoteOp() |
87 CIpsPlgImap4MoveRemoteOp::~CIpsPlgImap4MoveRemoteOp() |
88 { |
88 { |
89 FUNC_LOG; |
89 FUNC_LOG; |
90 delete iLocalSel; |
|
91 delete iRemoteSel; |
90 delete iRemoteSel; |
92 } |
91 } |
93 |
92 |
94 // ---------------------------------------------------------------------------- |
93 // ---------------------------------------------------------------------------- |
95 // ---------------------------------------------------------------------------- |
94 // ---------------------------------------------------------------------------- |
265 { |
263 { |
266 id = aSel[count]; |
264 id = aSel[count]; |
267 err = iMsvSession.GetEntry( id, service, tEntry ); |
265 err = iMsvSession.GetEntry( id, service, tEntry ); |
268 if( KErrNone == err ) |
266 if( KErrNone == err ) |
269 { |
267 { |
270 // local move is not needed, if the message is not fetched |
|
271 if( tEntry.Complete() ) |
|
272 { |
|
273 if ( 0 < count ) |
|
274 { |
|
275 // service id is not added to local, |
|
276 // service is already |
|
277 // added in MoveMessagesL |
|
278 iLocalSel->AppendL( id ); |
|
279 } |
|
280 } |
|
281 iRemoteSel->AppendL( id ); |
268 iRemoteSel->AppendL( id ); |
282 } |
269 } |
283 } |
270 } |
284 } |
271 } |
285 |
272 |
288 void CIpsPlgImap4MoveRemoteOp::Complete() |
275 void CIpsPlgImap4MoveRemoteOp::Complete() |
289 { |
276 { |
290 FUNC_LOG; |
277 FUNC_LOG; |
291 TRequestStatus* observer = &iObserverRequestStatus; |
278 TRequestStatus* observer = &iObserverRequestStatus; |
292 User::RequestComplete( observer, KErrNone ); |
279 User::RequestComplete( observer, KErrNone ); |
293 } |
|
294 |
|
295 // ---------------------------------------------------------------------------- |
|
296 // ---------------------------------------------------------------------------- |
|
297 void CIpsPlgImap4MoveRemoteOp::DoMoveLocalL() |
|
298 { |
|
299 FUNC_LOG; |
|
300 iState = ELocalMsgs; |
|
301 iStatus = KRequestPending; |
|
302 if( iLocalSel->Count() ) |
|
303 { |
|
304 // this gets the first msg to be moved |
|
305 CMsvEntry* cEntry = iMsvSession.GetEntryL( (*iLocalSel)[0] ); |
|
306 CleanupStack::PushL( cEntry ); |
|
307 // find the parent of the moved message... |
|
308 TMsvId parent = cEntry->Entry().Parent(); |
|
309 // and use it as a context |
|
310 cEntry->SetEntryL( parent ); |
|
311 |
|
312 delete iOperation; |
|
313 iOperation = NULL; |
|
314 iOperation = cEntry->MoveL( *iLocalSel, |
|
315 iGetMailInfo.iDestinationFolder, |
|
316 iStatus ); |
|
317 CleanupStack::PopAndDestroy( cEntry ); |
|
318 SetActive(); |
|
319 } |
|
320 else |
|
321 { |
|
322 SetActive(); |
|
323 CompleteThis(); |
|
324 } |
|
325 } |
280 } |
326 |
281 |
327 // ---------------------------------------------------------------------------- |
282 // ---------------------------------------------------------------------------- |
328 // ---------------------------------------------------------------------------- |
283 // ---------------------------------------------------------------------------- |
329 void CIpsPlgImap4MoveRemoteOp::DoMoveRemoteL() |
284 void CIpsPlgImap4MoveRemoteOp::DoMoveRemoteL() |