summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (show 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
@@ -154,21 +154,29 @@ void AbView::load()
154{ 154{
155 odebug << "AbView::Load data" << oendl; 155 odebug << "AbView::Load data" << oendl;
156 156
157 // Letter Search is stopped at this place 157 // Letter Search is stopped at this place
158 emit signalClearLetterPicker(); 158 emit signalClearLetterPicker();
159 159
160 if ( m_inPersonal ) 160 if ( m_curr_category == 0 ) {
161 // VCard Backend does not sort.. 161 // Show unfiled
162 m_list = m_contactdb->allRecords(); 162 m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName,
163 else{ 163 Opie::OPimContactAccess::DoNotShowWithCategory, 0 );
164 m_list = m_contactdb->sorted( true, 0, 0, 0 ); 164 } elseif ( m_curr_category != -1 ){
165 if ( m_curr_category != -1 ) 165 // Just show selected category
166 clearForCategory(); 166 m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName,
167 Opie::OPimBase::FilterCategory, m_curr_category );
168 } else {
169 // Show all categories
170 m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName,
171 Opie::OPimBase::FilterOff, 0 );
167 } 172 }
168 173
174 // if ( m_curr_category != -1 )
175 // clearForCategory();
176
169 odebug << "Number of contacts: " << m_list.count() << oendl; 177 odebug << "Number of contacts: " << m_list.count() << oendl;
170 178
171 updateView( true ); 179 updateView( true );
172 180
173} 181}
174 182
@@ -234,13 +242,16 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode )
234 if ( c == 0 ){ 242 if ( c == 0 ){
235 load(); 243 load();
236 return; 244 return;
237 }else{ 245 }else{
238 // If the current Backend is unable to solve the query, we will 246 // If the current Backend is unable to solve the query, we will
239 // ignore the request .. 247 // ignore the request ..
240 if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ) ){ 248 if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards |
249 Opie::OPimContactAccess::IgnoreCase ) ){
250 owarn << "Tried to access queryByExample which is not supported by the current backend!!" << oendl;
251 owarn << "I have to ignore this access!" << oendl;
241 return; 252 return;
242 } 253 }
243 254
244 switch( mode ){ 255 switch( mode ){
245 case AbConfig::LastName: 256 case AbConfig::LastName:
246 query.setLastName( QString("%1*").arg(c) ); 257 query.setLastName( QString("%1*").arg(c) );