-rw-r--r-- | core/pim/addressbook/abview.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 34035fd..8a2db96 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp @@ -148,29 +148,39 @@ bool AbView::save() // odebug << "AbView::Save data" << oendl; return m_contactdb->save(); } void AbView::load() { odebug << "AbView::Load data" << oendl; // Letter Search is stopped at this place emit signalClearLetterPicker(); - m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, - Opie::OPimContactAccess::FilterCategory, m_curr_category ); + odebug << "selected Category: " << m_curr_category << oendl; -// if ( m_curr_category != -1 ) -// clearForCategory(); + if ( m_curr_category == -1 ) { + // Show just unfiled contacts + m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, + Opie::OPimContactAccess::DoNotShowWithCategory, 0 ); + } else if ( m_curr_category == 0 ){ + // Just show all contacts + m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, + Opie::OPimBase::FilterOff, 0 ); + } else { + // Show contacts with given categories + m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, + Opie::OPimBase::FilterCategory, m_curr_category ); + } odebug << "Number of contacts: " << m_list.count() << oendl; updateView( true ); } void AbView::reload() { odebug << "AbView::::reload()" << oendl; m_contactdb->reload(); |