summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abview.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp
index 7abb45c..6be19f8 100644
--- a/core/pim/addressbook/abview.cpp
+++ b/core/pim/addressbook/abview.cpp
@@ -148,32 +148,40 @@ 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();
- if ( m_inPersonal )
- // VCard Backend does not sort..
- m_list = m_contactdb->allRecords();
- else{
- m_list = m_contactdb->sorted( true, 0, 0, 0 );
- if ( m_curr_category != -1 )
- clearForCategory();
+ if ( m_curr_category == 0 ) {
+ // Show unfiled
+ m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName,
+ Opie::OPimContactAccess::DoNotShowWithCategory, 0 );
+ } else if ( m_curr_category != -1 ){
+ // Just show selected category
+ m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName,
+ Opie::OPimBase::FilterCategory, m_curr_category );
+ } else {
+ // Show all categories
+ m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName,
+ Opie::OPimBase::FilterOff, 0 );
}
+
+// if ( m_curr_category != -1 )
+// clearForCategory();
odebug << "Number of contacts: " << m_list.count() << oendl;
updateView( true );
}
void AbView::reload()
{
odebug << "AbView::::reload()" << oendl;
m_contactdb->reload();
@@ -228,25 +236,28 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode )
{
odebug << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl;
assert( mode < AbConfig::LASTELEMENT );
Opie::OPimContact query;
if ( c == 0 ){
load();
return;
}else{
// If the current Backend is unable to solve the query, we will
// ignore the request ..
- if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ) ){
+ if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards |
+ Opie::OPimContactAccess::IgnoreCase ) ){
+ owarn << "Tried to access queryByExample which is not supported by the current backend!!" << oendl;
+ owarn << "I have to ignore this access!" << oendl;
return;
}
switch( mode ){
case AbConfig::LastName:
query.setLastName( QString("%1*").arg(c) );
break;
case AbConfig::FileAs:
query.setFileAs( QString("%1*").arg(c) );
break;
default:
owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl