-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 @@ -159,7 +159,17 @@ void AbView::load() - 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 ); + } |