phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchercontacthandler.cpp
branchRCL_3
changeset 35 4ae315f230bc
parent 26 0d28c1c5b6dd
child 64 c1e8ba0c2b16
equal deleted inserted replaced
32:2828b4d142c0 35:4ae315f230bc
    64         {
    64         {
    65         iCmsWrapper->RemoveObserver( *this );
    65         iCmsWrapper->RemoveObserver( *this );
    66         iCmsWrapper->Release();
    66         iCmsWrapper->Release();
    67         }
    67         }
    68     iDynamicVoipAddressGroup.Close();
    68     iDynamicVoipAddressGroup.Close();
       
    69     iAddressCache.Close();
    69     }
    70     }
    70 
    71 
    71 // --------------------------------------------------------------------------
    72 // --------------------------------------------------------------------------
    72 // CCCAppCommLauncherContactHandler::NewL
    73 // CCCAppCommLauncherContactHandler::NewL
    73 // --------------------------------------------------------------------------
    74 // --------------------------------------------------------------------------
   163         }
   164         }
   164     else if ( MCCAppContactFieldDataObserver::TParameter::EContactsChanged 
   165     else if ( MCCAppContactFieldDataObserver::TParameter::EContactsChanged 
   165         == aParameter.iType )
   166         == aParameter.iType )
   166         {
   167         {
   167         iDynamicAddressGroupSet = EFalse;
   168         iDynamicAddressGroupSet = EFalse;
       
   169         iAddressCache.Close(); // reset cache on change
   168         iObserver.ContactsChangedL();
   170         iObserver.ContactsChangedL();
   169         }
   171         }
   170     else if (MCCAppContactFieldDataObserver::TParameter::EContactPresenceChanged == aParameter.iType)
   172     else if (MCCAppContactFieldDataObserver::TParameter::EContactPresenceChanged == aParameter.iType)
   171         {
   173         {
   172         iObserver.ContactPresenceChangedL(*aParameter.iContactField);
   174         iObserver.ContactPresenceChangedL(*aParameter.iContactField);
   226 // ---------------------------------------------------------------------------
   228 // ---------------------------------------------------------------------------
   227 //
   229 //
   228 TInt CCCAppCommLauncherContactHandler::AddressAmount( 
   230 TInt CCCAppCommLauncherContactHandler::AddressAmount( 
   229     VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aContactAction )
   231     VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aContactAction )
   230     {
   232     {
   231     return iCmsWrapper->GetContactActionFieldCount(aContactAction);
   233     TInt* count = iAddressCache.Find( aContactAction );
       
   234     if( !count )
       
   235         {
       
   236         TInt newcount = iCmsWrapper->GetContactActionFieldCount( aContactAction );
       
   237         iAddressCache.Insert( aContactAction, newcount );
       
   238         return newcount;
       
   239         }
       
   240     return *count;
   232     }
   241     }
   233 
   242 
   234 // ---------------------------------------------------------------------------
   243 // ---------------------------------------------------------------------------
   235 // CCCAppCommLauncherContactHandler::IsServiceAvailable
   244 // CCCAppCommLauncherContactHandler::IsServiceAvailable
   236 // ---------------------------------------------------------------------------
   245 // ---------------------------------------------------------------------------
   547 // 
   556 // 
   548 void CCCAppCommLauncherContactHandler::RefetchContactL()
   557 void CCCAppCommLauncherContactHandler::RefetchContactL()
   549     {
   558     {
   550     iCmsWrapper->RefetchContactL();
   559     iCmsWrapper->RefetchContactL();
   551     iCmsWrapper->AddObserverL( *this );
   560     iCmsWrapper->AddObserverL( *this );
       
   561     iAddressCache.Close();
   552     }
   562     }
   553 
   563 
   554 // --------------------------------------------------------------------------
   564 // --------------------------------------------------------------------------
   555 // CCCAppCommLauncherContactHandler::IsTopContact
   565 // CCCAppCommLauncherContactHandler::IsTopContact
   556 // --------------------------------------------------------------------------
   566 // --------------------------------------------------------------------------