summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.cpp
authoreilers <eilers>2003-05-11 12:36:30 (UTC)
committer eilers <eilers>2003-05-11 12:36:30 (UTC)
commit37084d3961026893840ef9891132bdf193a312b3 (patch) (side-by-side diff)
tree342792abd777eb11a378cc5e06e0436ab48f6d89 /core/pim/addressbook/abview.cpp
parentb068a42c89af19f5642b68060c1d085afa78e7b1 (diff)
downloadopie-37084d3961026893840ef9891132bdf193a312b3.zip
opie-37084d3961026893840ef9891132bdf193a312b3.tar.gz
opie-37084d3961026893840ef9891132bdf193a312b3.tar.bz2
Some improvements in handling of organizations:
- If you enter a organization name and no Fullname is entered, the organization name will be used. Thus, the organization is shown correctly in the listview.. - The letterpicker now searches for the SaveAs Entry (configurable) instead for lastname. Ths guarantees that the organization is found as expected.. This addresses bugreport #590 and #895..
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/abview.cpp22
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
@@ -19,12 +19,14 @@
#include <qlayout.h>
#include <qpe/global.h>
#include <opie/ocontactaccessbackend_vcard.h>
+#include <assert.h>
+
// Is defined in LibQPE
extern QString categoryFileName();
QString addressbookPersonalVCardName()
{
@@ -157,13 +159,13 @@ void AbView::load()
m_list = m_contactdb->allRecords();
else{
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 );
}
void AbView::reload()
@@ -215,27 +217,41 @@ void AbView::setShowToView( Views view )
updateView();
}
}
-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;
}else{
// If the current Backend is unable to solve the query, we will
// ignore the request ..
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;
}
updateView( true );
}