Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/abview.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index d3ca783..664bd3f 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp @@ -21,8 +21,10 @@ #include <qpe/global.h> #include <opie/ocontactaccessbackend_vcard.h> +#include <assert.h> + // Is defined in LibQPE extern QString categoryFileName(); @@ -159,9 +161,9 @@ void AbView::load() m_list = m_contactdb->sorted( true, 0, 0, 0 ); clearForCategory(); } - // qWarning ("Number of contacts: %d", m_list.count()); + qWarning ("Number of contacts: %d", m_list.count()); updateView( true ); } @@ -217,11 +219,14 @@ void AbView::setShowToView( Views view ) } } -void AbView::setShowByLetter( char c ) +void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) { - // qWarning("void AbView::setShowByLetter( %c )", c ); + qWarning("void AbView::setShowByLetter( %c, %d )", c, mode ); + + assert( mode < AbConfig::LASTELEMENT ); + OContact query; if ( c == 0 ){ load(); return; @@ -231,9 +236,20 @@ void AbView::setShowByLetter( char c ) if ( ! m_contactdb->hasQuerySettings( OContactAccess::WildCards | OContactAccess::IgnoreCase ) ){ return; } + switch( mode ){ + case AbConfig::LastName: query.setLastName( QString("%1*").arg(c) ); + break; + case AbConfig::FullName: + query.setFileAs( QString("%1*").arg(c) ); + break; + default: + qWarning( "Unknown Searchmode for AbView::setShowByLetter ! -> %d", mode ); + qWarning( "I will ignore it.." ); + return; + } m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); clearForCategory(); m_curr_Contact = 0; } |