35 #include <CPbk2StoreManager.h> |
35 #include <CPbk2StoreManager.h> |
36 #include <TVPbkContactStoreUriPtr.h> |
36 #include <TVPbkContactStoreUriPtr.h> |
37 #include <VPbkContactStoreUris.h> |
37 #include <VPbkContactStoreUris.h> |
38 #include <mccappengine.h> |
38 #include <mccappengine.h> |
39 #include <ccacontactorservice.h> |
39 #include <ccacontactorservice.h> |
|
40 #include <MVPbkContactStoreProperties.h> |
|
41 #include <MVPbkContactStore.h> |
40 |
42 |
41 #include <Pbk2DataCaging.hrh> |
43 #include <Pbk2DataCaging.hrh> |
42 |
44 |
43 #include "ccappdetailsviewplugin.h" |
45 #include "ccappdetailsviewplugin.h" |
44 #include "ccappdetailsviewlistboxmodel.h" |
46 #include "ccappdetailsviewlistboxmodel.h" |
95 // |
97 // |
96 CCCAppDetailsViewPlugin::~CCCAppDetailsViewPlugin() |
98 CCCAppDetailsViewPlugin::~CCCAppDetailsViewPlugin() |
97 { |
99 { |
98 //CCA_DP(KDetailsViewLogFile, CCA_L(">>> CCCAppDetailsViewPlugin::~CCCAppDetailsViewPlugin()")); |
100 //CCA_DP(KDetailsViewLogFile, CCA_L(">>> CCCAppDetailsViewPlugin::~CCCAppDetailsViewPlugin()")); |
99 |
101 |
|
102 //Delete the Contact Link |
|
103 delete iLink; |
|
104 |
100 //BG task for checking the visibility of this plugin |
105 //BG task for checking the visibility of this plugin |
101 if (iBgTaskForCheckingVisibility) |
106 if (iBgTaskForCheckingVisibility) |
102 { |
107 { |
103 iBgTaskForCheckingVisibility->Cancel(); |
108 iBgTaskForCheckingVisibility->Cancel(); |
104 delete iBgTaskForCheckingVisibility; |
109 delete iBgTaskForCheckingVisibility; |
191 } |
196 } |
192 CPbk2StoreManager& storeManager = pbk2AppServices.StoreManager(); |
197 CPbk2StoreManager& storeManager = pbk2AppServices.StoreManager(); |
193 storeManager.RegisterStoreEventsL(*this); |
198 storeManager.RegisterStoreEventsL(*this); |
194 storeManager.OpenStoresL(); |
199 storeManager.OpenStoresL(); |
195 |
200 |
|
201 //Get the Contact Link |
|
202 HBufC& contactData = AppEngine()->Parameter().ContactDataL(); |
|
203 HBufC8* contactData8 = HBufC8::NewLC( contactData.Size() ); |
|
204 TPtr8 contactData8Ptr( contactData8->Des() ); |
|
205 contactData8Ptr.Copy( contactData.Des() ); |
|
206 CVPbkContactManager* vPbkContactManager = &iAppServices->ContactManager(); |
|
207 |
|
208 if( vPbkContactManager ) |
|
209 { |
|
210 MVPbkContactLinkArray* contactArray = NULL; |
|
211 contactArray = vPbkContactManager->CreateLinksLC( contactData8Ptr ); |
|
212 if( contactArray->Count() > 0 ) |
|
213 { |
|
214 iLink = contactArray->At( 0 ).CloneLC(); |
|
215 CleanupStack::Pop(); //link |
|
216 } |
|
217 if( contactArray ) |
|
218 { |
|
219 CleanupStack::PopAndDestroy(); // contactArray |
|
220 } |
|
221 } |
|
222 CleanupStack::PopAndDestroy(); // contactData8 |
|
223 |
196 iSchedulerWait.Start(); |
224 iSchedulerWait.Start(); |
197 |
225 |
198 BaseConstructL(R_CCAPPDETAILSVIEW_MAINVIEW); |
226 BaseConstructL(R_CCAPPDETAILSVIEW_MAINVIEW); |
199 } |
227 } |
200 |
228 |
441 |
469 |
442 // -------------------------------------------------------------------------- |
470 // -------------------------------------------------------------------------- |
443 // CCCAppDetailsViewPlugin::StoreReady |
471 // CCCAppDetailsViewPlugin::StoreReady |
444 // -------------------------------------------------------------------------- |
472 // -------------------------------------------------------------------------- |
445 // |
473 // |
446 void CCCAppDetailsViewPlugin::StoreReady(MVPbkContactStore& /*aContactStore*/) |
474 void CCCAppDetailsViewPlugin::StoreReady(MVPbkContactStore& aContactStore) |
447 { |
475 { |
448 if (iSchedulerWait.IsStarted()) |
476 if( iLink ) |
449 { |
477 { |
450 iSchedulerWait.AsyncStop(); |
478 const MVPbkContactStoreProperties& storeProperties = |
451 } |
479 iLink->ContactStore().StoreProperties(); |
|
480 TVPbkContactStoreUriPtr uri = storeProperties.Uri(); |
|
481 if( 0 == uri.Compare( aContactStore.StoreProperties().Uri(), |
|
482 TVPbkContactStoreUriPtr::EContactStoreUriAllComponents ) ) |
|
483 { |
|
484 delete iLink; |
|
485 iLink = NULL; |
|
486 if ( iSchedulerWait.IsStarted() ) |
|
487 { |
|
488 iSchedulerWait.AsyncStop(); |
|
489 } |
|
490 } |
|
491 } |
|
492 else |
|
493 { |
|
494 //We shouldnt get here |
|
495 //but if so, lets be safe |
|
496 if ( iSchedulerWait.IsStarted() ) |
|
497 { |
|
498 iSchedulerWait.AsyncStop(); |
|
499 } |
|
500 } |
|
501 |
|
502 |
452 } |
503 } |
453 |
504 |
454 // -------------------------------------------------------------------------- |
505 // -------------------------------------------------------------------------- |
455 // CCCAppDetailsViewPlugin::StoreUnavailable |
506 // CCCAppDetailsViewPlugin::StoreUnavailable |
456 // -------------------------------------------------------------------------- |
507 // -------------------------------------------------------------------------- |