summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.cpp
Unidiff
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()
148 //odebug << "AbView::Save data" << oendl; 148 //odebug << "AbView::Save data" << oendl;
149 149
150 return m_contactdb->save(); 150 return m_contactdb->save();
151} 151}
152 152
153void AbView::load() 153void 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 }
173
174 // if ( m_curr_category != -1 )
175 // clearForCategory();
168 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
175void AbView::reload() 183void AbView::reload()
176{ 184{
177 odebug << "AbView::::reload()" << oendl; 185 odebug << "AbView::::reload()" << oendl;
178 186
179 m_contactdb->reload(); 187 m_contactdb->reload();
@@ -228,25 +236,28 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode )
228{ 236{
229 odebug << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl; 237 odebug << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl;
230 238
231 assert( mode < AbConfig::LASTELEMENT ); 239 assert( mode < AbConfig::LASTELEMENT );
232 240
233 Opie::OPimContact query; 241 Opie::OPimContact query;
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) );
247 break; 258 break;
248 case AbConfig::FileAs: 259 case AbConfig::FileAs:
249 query.setFileAs( QString("%1*").arg(c) ); 260 query.setFileAs( QString("%1*").arg(c) );
250 break; 261 break;
251 default: 262 default:
252 owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl 263 owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl