diff -r 04ab22b956c2 -r 81f8547efd4f phonebookui/Phonebook2/UIControls/src/CPbk2FetchDlgPage.cpp --- a/phonebookui/Phonebook2/UIControls/src/CPbk2FetchDlgPage.cpp Fri Feb 19 22:40:27 2010 +0200 +++ b/phonebookui/Phonebook2/UIControls/src/CPbk2FetchDlgPage.cpp Fri Mar 12 15:41:25 2010 +0200 @@ -27,6 +27,9 @@ #include #include #include +#include +#include +#include // Virtual Phonebook #include @@ -87,6 +90,10 @@ { iContactView->RemoveObserver( *iControl ); } + if ( iStoreConfiguration ) + { + iStoreConfiguration->RemoveObserver( *this ); + } } // -------------------------------------------------------------------------- @@ -101,6 +108,8 @@ iControl->AddObserverL( *this ); iContactView->AddObserverL( *iControl ); + iStoreConfiguration = &Phonebook2::Pbk2AppUi()->ApplicationServices().StoreConfiguration(); + iStoreConfiguration->AddObserverL( *this ); AknLayoutUtils::LayoutControl ( iControl, iParentDlg.FetchDlgClientRect(), @@ -383,4 +392,42 @@ return text; } +// -------------------------------------------------------------------------- +// CPbk2FetchDlgPage::ConfigurationChanged +// -------------------------------------------------------------------------- +// +void CPbk2FetchDlgPage::ConfigurationChanged() + { + if ( iControl ) + { + iControl->Reset(); + } + } + +// -------------------------------------------------------------------------- +// CPbk2FetchDlgPage::ConfigurationChangedComplete +// -------------------------------------------------------------------------- +// +void CPbk2FetchDlgPage::ConfigurationChangedComplete() + { + if ( iControl ) + { + MVPbkContactViewBase* allContactsView = NULL; + + TRAPD( res, allContactsView = Phonebook2::Pbk2AppUi()-> + ApplicationServices().ViewSupplier().AllContactsViewL() ); + + if ( res == KErrNone ) + { + TRAP( res, iControl->SetViewL( *allContactsView ) ); + iControl->DrawNow(); + } + + if ( res != KErrNone ) + { + CCoeEnv::Static()->HandleError( res ); + iControl->Reset(); + } + } + } // End of File