67 // --------------------------------------------------------------------------- |
67 // --------------------------------------------------------------------------- |
68 void CIpsPlgSyncStateHandler::HandlePropertyEventL( |
68 void CIpsPlgSyncStateHandler::HandlePropertyEventL( |
69 TInt aEvent, TInt aMailbox, TInt aPluginId ,TInt /*aError*/ ) |
69 TInt aEvent, TInt aMailbox, TInt aPluginId ,TInt /*aError*/ ) |
70 { |
70 { |
71 FUNC_LOG; |
71 FUNC_LOG; |
72 if ( iPlugin.PluginId() == aPluginId && |
72 // <qmail> removed sync-on-hold state |
73 ( aEvent == KIpsSosEmailSyncStarted || |
73 if ( ( iPlugin.PluginId() == aPluginId ) && |
74 aEvent == KIpsSosEmailSyncCompleted || |
74 ( aEvent == KIpsSosEmailSyncStarted || aEvent == KIpsSosEmailSyncCompleted ) ) |
75 aEvent == KIpsSosEmailSyncOnHold ) ) |
75 { |
76 { |
76 AppendMailboxToSyncingMailboxL( aMailbox, aEvent ); |
77 AppendMailboxToSyncingMailbox( aMailbox, aEvent ); |
|
78 } |
77 } |
79 } |
78 } |
80 |
79 |
81 // --------------------------------------------------------------------------- |
80 // --------------------------------------------------------------------------- |
82 // --------------------------------------------------------------------------- |
81 // --------------------------------------------------------------------------- |
131 { |
132 { |
132 return EmailSyncing; |
133 return EmailSyncing; |
133 } |
134 } |
134 } |
135 } |
135 aosession.Close(); |
136 aosession.Close(); |
|
137 #endif |
|
138 |
|
139 // </cmail> |
136 |
140 |
137 // found correct operation |
141 // found correct operation |
138 for ( TInt i = 0; i < iOperationsRef.Count(); i++ ) |
142 for ( TInt i = 0; i < iOperationsRef.Count(); i++ ) |
139 { |
143 { |
140 const CIpsPlgBaseOperation* baseOp = iOperationsRef[i]->BaseOperation(); |
144 const CIpsPlgBaseOperation* baseOp = iOperationsRef[i]->BaseOperation(); |
141 |
145 |
142 if ( baseOp && baseOp->FSMailboxId() == aMailboxId && |
146 if ( baseOp && baseOp->FSMailboxId() == aMailboxId && |
143 ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp || |
147 ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp || |
144 baseOp->IpsOpType() == EIpsOpTypePop3PopulateOp || |
|
145 baseOp->IpsOpType() == EIpsOpTypeImap4SyncOp || |
148 baseOp->IpsOpType() == EIpsOpTypeImap4SyncOp || |
146 baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) ) |
149 baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) ) |
147 { |
150 { |
148 // Due to timing problems we might in some rare cases report |
151 // Due to timing problems we might in some rare cases report |
149 // EmailSyncing here even if the actual syncing is already |
152 // EmailSyncing here even if the actual syncing is already |
167 { |
170 { |
168 const CIpsPlgBaseOperation* baseOp = iOperationsRef[i]->BaseOperation(); |
171 const CIpsPlgBaseOperation* baseOp = iOperationsRef[i]->BaseOperation(); |
169 |
172 |
170 if ( baseOp && baseOp->FSMailboxId() == aMailBoxId && |
173 if ( baseOp && baseOp->FSMailboxId() == aMailBoxId && |
171 ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp |
174 ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp |
172 || baseOp->IpsOpType() == EIpsOpTypePop3PopulateOp |
|
173 || baseOp->IpsOpType() == EIpsOpTypeImap4SyncOp |
175 || baseOp->IpsOpType() == EIpsOpTypeImap4SyncOp |
174 || baseOp->IpsOpType() == EIpsOpTypeOnlineOp |
176 || baseOp->IpsOpType() == EIpsOpTypeOnlineOp |
175 || baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) ) |
177 || baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) ) |
176 { |
178 { |
177 // Due to timing problems we might in some rare cases report |
179 // Due to timing problems we might in some rare cases report |
206 } |
208 } |
207 else |
209 else |
208 { |
210 { |
209 ipsState = KIpsSosEmailSyncCompleted; |
211 ipsState = KIpsSosEmailSyncCompleted; |
210 } |
212 } |
211 TInt count = iSyncingMailboxes.Append( |
213 // the next call, FindMailbox, handles the case |
|
214 // if .Append is failing, thus the return value can |
|
215 // be ignored |
|
216 TInt ignore = iSyncingMailboxes.Append( |
212 TIpsMailboxState( aMailbox, ipsState ) ); |
217 TIpsMailboxState( aMailbox, ipsState ) ); |
213 index = FindMailbox( aMailbox ); |
218 index = FindMailbox( aMailbox ); |
214 } |
219 } |
215 |
220 |
216 return index; |
221 return index; |
233 return index; |
238 return index; |
234 } |
239 } |
235 |
240 |
236 // --------------------------------------------------------------------------- |
241 // --------------------------------------------------------------------------- |
237 // --------------------------------------------------------------------------- |
242 // --------------------------------------------------------------------------- |
238 void CIpsPlgSyncStateHandler::AppendMailboxToSyncingMailbox( |
243 void CIpsPlgSyncStateHandler::AppendMailboxToSyncingMailboxL( |
239 TMsvId aMailbox, TInt aState ) |
244 TMsvId aMailbox, TInt aState ) |
240 { |
245 { |
241 FUNC_LOG; |
246 FUNC_LOG; |
242 TInt index = FindMailbox( aMailbox ); |
247 TInt index = FindMailbox( aMailbox ); |
243 if ( index == KErrNotFound ) |
248 if ( index == KErrNotFound ) |
244 { |
249 { |
245 iSyncingMailboxes.Append( TIpsMailboxState( aMailbox, aState ) ); |
250 iSyncingMailboxes.AppendL( TIpsMailboxState( aMailbox, aState ) ); |
246 } |
251 } |
247 else |
252 else |
248 { |
253 { |
249 iSyncingMailboxes[index].iState = aState; // faulty CS warning |
254 iSyncingMailboxes[index].iState = aState; // faulty CS warning |
250 } |
255 } |
295 } |
300 } |
296 |
301 |
297 // --------------------------------------------------------------------------- |
302 // --------------------------------------------------------------------------- |
298 // --------------------------------------------------------------------------- |
303 // --------------------------------------------------------------------------- |
299 void CIpsPlgSyncStateHandler::SaveSuccessfulSyncTimeL( |
304 void CIpsPlgSyncStateHandler::SaveSuccessfulSyncTimeL( |
300 CMsvSession& aSession, TMsvId aService ) |
305 CMsvSession& /*aSession*/, TMsvId /*aService*/ ) |
301 { |
306 { |
302 FUNC_LOG; |
307 FUNC_LOG; |
303 TTime now; |
308 TTime now; |
304 now.HomeTime(); |
309 now.HomeTime(); |
305 CIpsSetDataExtension* extendedSettings = CIpsSetDataExtension::NewLC(); |
310 // <qmail> |
306 CIpsSetDataApi* dataApi = CIpsSetDataApi::NewL( aSession ); |
311 //CIpsSetDataExtension* extendedSettings = CIpsSetDataExtension::NewLC(); |
307 CleanupStack::PushL( dataApi ); |
312 //CIpsSetDataApi* dataApi = CIpsSetDataApi::NewL( aSession ); |
308 dataApi->LoadExtendedSettingsL( aService, *extendedSettings ); |
313 //CleanupStack::PushL( dataApi ); |
309 TAOInfo info; |
314 //dataApi->LoadExtendedSettingsL( aService, *extendedSettings ); |
310 info.iLastSuccessfulUpdate = now; |
315 //TAOInfo info; |
311 info.iUpdateSuccessfulWithCurSettings = ETrue; |
316 //info.iLastSuccessfulUpdate = now; |
312 info.iLastUpdateFailed = EFalse; |
317 //info.iUpdateSuccessfulWithCurSettings = ETrue; |
313 extendedSettings->SetLastUpdateInfo( info ); |
318 //extendedSettings->SetLastUpdateInfo( info ); |
314 // clear flag |
319 // clear flag |
315 extendedSettings->SetEmnReceivedButNotSyncedFlag( EFalse ); |
320 //extendedSettings->SetEmnReceivedButNotSyncedFlag( EFalse ); |
316 dataApi->SaveExtendedSettingsL( *extendedSettings ); |
321 //dataApi->SaveExtendedSettingsL( *extendedSettings ); |
317 CleanupStack::PopAndDestroy( 2, extendedSettings ); |
322 //CleanupStack::PopAndDestroy( 2, extendedSettings ); |
|
323 // </qmail> |
318 } |
324 } |
319 |
325 |
320 |
326 |
321 // End of file |
327 // End of file |
322 |
328 |