From 29f05e7138a05c2c32cad8b40fd432cd383964a9 Mon Sep 17 00:00:00 2001 From: eilers Date: Mon, 20 Dec 2004 14:19:24 +0000 Subject: Fix for Bug #1269 and use of new sorted of the pim libary --- 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 @@ -157,14 +157,22 @@ void AbView::load() // 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; @@ -237,7 +245,10 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) }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; } diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 835038a..0654e1a 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -352,6 +352,13 @@ void AddressbookWindow::setDocument( const QString &filename ) { odebug << "void AddressbookWindow::setDocument( " << filename << " )" << oendl; + // Switch to default backend. This should avoid to import into + // the personal database accidently. + if ( actionPersonal->isOn() ){ + actionPersonal->setOn( false ); + slotPersonalView(); + } + if ( filename.find(".vcf") != int(filename.length()) - 4 ){ diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h index 9217e95..7cc61bf 100644 --- a/core/pim/addressbook/addressbook.h +++ b/core/pim/addressbook/addressbook.h @@ -64,7 +64,7 @@ public slots: void flush(); void reload(); void appMessage(const QCString &, const QByteArray &); - void setDocument( const QString & ); + void setDocument( const QString & ); // Called by obex receiver and internally! #ifdef __DEBUG_RELEASE // void slotSave(); #endif diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index 790aa95..7ce9752 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h @@ -3,7 +3,7 @@ #define MAINVERSION "1" #define SUBVERSION "1" -#define PATCHVERSION "0" +#define PATCHVERSION "1" #define APPNAME "OPIE_ADDRESSBOOK" -- cgit v0.9.0.2