summaryrefslogtreecommitdiff
authordrw <drw>2005-03-16 17:45:28 (UTC)
committer drw <drw>2005-03-16 17:45:28 (UTC)
commit44209002d51056e0d198b63463ebc686b41e8cd8 (patch) (unidiff)
treed61069f16d8382959065cf7fe43d4e68ad448daf
parentd16a2a4e0617f21cba0e399dbe5ffa17d76886b9 (diff)
downloadopie-44209002d51056e0d198b63463ebc686b41e8cd8.zip
opie-44209002d51056e0d198b63463ebc686b41e8cd8.tar.gz
opie-44209002d51056e0d198b63463ebc686b41e8cd8.tar.bz2
Fixed: 1. Category handling - all other apps and libopie2 use -1 for unfiled and 0 for all, addressbook flipped them, 2. Letter picker record selection, 3. sort resulting records after letter picker selected them
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp1
-rw-r--r--core/pim/addressbook/abview.cpp44
-rw-r--r--core/pim/addressbook/addressbook.cpp7
3 files changed, 25 insertions, 27 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 0be7d1a..49e66ad 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -138,49 +138,48 @@ AbTable::~AbTable()
138 138
139void AbTable::init() 139void AbTable::init()
140{ 140{
141 // :SX showChar = '\0'; 141 // :SX showChar = '\0';
142 setNumRows( 0 ); 142 setNumRows( 0 );
143 setNumCols( 2 ); 143 setNumCols( 2 );
144 144
145 horizontalHeader()->setLabel( 0, tr( "Full Name" )); 145 horizontalHeader()->setLabel( 0, tr( "Full Name" ));
146 horizontalHeader()->setLabel( 1, tr( "Contact" )); 146 horizontalHeader()->setLabel( 1, tr( "Contact" ));
147 setLeftMargin( 0 ); 147 setLeftMargin( 0 );
148 verticalHeader()->hide(); 148 verticalHeader()->hide();
149 columnVisible = true; 149 columnVisible = true;
150} 150}
151 151
152void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList ) 152void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList )
153{ 153{
154 odebug << "AbTable::setContacts()" << oendl; 154 odebug << "AbTable::setContacts()" << oendl;
155 155
156 clear(); 156 clear();
157 m_viewList = viewList; 157 m_viewList = viewList;
158 158
159 setSorting( false ); 159 setSorting( false );
160 setPaintingEnabled( FALSE ); 160 setPaintingEnabled( FALSE );
161 161
162 Opie::OPimContactAccess::List::Iterator it;
163 setNumRows( m_viewList.count() ); 162 setNumRows( m_viewList.count() );
164 //int row = 0; 163 //int row = 0;
165 // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) 164 // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it )
166 // insertIntoTable( *it, row++ ); 165 // insertIntoTable( *it, row++ );
167 166
168 // setSorting( true ); 167 // setSorting( true );
169 168
170 // resort(); 169 // resort();
171 170
172 updateVisible(); 171 updateVisible();
173 172
174 setPaintingEnabled( TRUE ); 173 setPaintingEnabled( TRUE );
175 174
176} 175}
177 176
178void AbTable::setOrderedList( const QValueList<int> ordered ) 177void AbTable::setOrderedList( const QValueList<int> ordered )
179{ 178{
180 intFields = ordered; 179 intFields = ordered;
181} 180}
182 181
183 182
184bool AbTable::selectContact( int UID ) 183bool AbTable::selectContact( int UID )
185{ 184{
186 odebug << "AbTable::selectContact( " << UID << " )" << oendl; 185 odebug << "AbTable::selectContact( " << UID << " )" << oendl;
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp
index 6be19f8..34035fd 100644
--- a/core/pim/addressbook/abview.cpp
+++ b/core/pim/addressbook/abview.cpp
@@ -21,49 +21,49 @@
21 21
22#include <qpe/global.h> 22#include <qpe/global.h>
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25 25
26#include <assert.h> 26#include <assert.h>
27 27
28 28
29// Is defined in LibQPE 29// Is defined in LibQPE
30extern QString categoryFileName(); 30extern QString categoryFileName();
31 31
32QString addressbookPersonalVCardName() 32QString addressbookPersonalVCardName()
33{ 33{
34 QString filename = Global::applicationFileName("addressbook", 34 QString filename = Global::applicationFileName("addressbook",
35 "businesscard.vcf"); 35 "businesscard.vcf");
36 return filename; 36 return filename;
37} 37}
38 38
39 39
40AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): 40AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ):
41 QWidget(parent), 41 QWidget(parent),
42 mCat(0), 42 mCat(0),
43 m_inSearch( false ), 43 m_inSearch( false ),
44 m_inPersonal( false ), 44 m_inPersonal( false ),
45 m_curr_category( -1 ), 45 m_curr_category( 0 ),
46 m_curr_View( TableView ), 46 m_curr_View( TableView ),
47 m_prev_View( TableView ), 47 m_prev_View( TableView ),
48 m_curr_Contact ( 0 ), 48 m_curr_Contact ( 0 ),
49 m_contactdb ( 0l ), 49 m_contactdb ( 0l ),
50 m_storedDB ( 0l ), 50 m_storedDB ( 0l ),
51 m_viewStack( 0l ), 51 m_viewStack( 0l ),
52 m_abTable( 0l ), 52 m_abTable( 0l ),
53 m_orderedFields( ordered ) 53 m_orderedFields( ordered )
54{ 54{
55 odebug << "AbView::c'tor" << oendl; 55 odebug << "AbView::c'tor" << oendl;
56 // Load default database and handle syncing myself.. ! 56 // Load default database and handle syncing myself.. !
57 m_contactdb = new Opie::OPimContactAccess ( "addressbook", 0l, 0l, false ); 57 m_contactdb = new Opie::OPimContactAccess ( "addressbook", 0l, 0l, false );
58 m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available 58 m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available
59 mCat.load( categoryFileName() ); 59 mCat.load( categoryFileName() );
60 60
61 // Create Layout and put WidgetStack into it. 61 // Create Layout and put WidgetStack into it.
62 QVBoxLayout *vb = new QVBoxLayout( this ); 62 QVBoxLayout *vb = new QVBoxLayout( this );
63 m_viewStack = new QWidgetStack( this ); 63 m_viewStack = new QWidgetStack( this );
64 vb->addWidget( m_viewStack ); 64 vb->addWidget( m_viewStack );
65 65
66 // Creat TableView 66 // Creat TableView
67 QVBox* tableBox = new QVBox( m_viewStack ); 67 QVBox* tableBox = new QVBox( m_viewStack );
68 m_abTable = new AbTable( m_orderedFields, tableBox, "table" ); 68 m_abTable = new AbTable( m_orderedFields, tableBox, "table" );
69 m_abTable->setCurrentCell( 0, 0 ); 69 m_abTable->setCurrentCell( 0, 0 );
@@ -136,158 +136,154 @@ Opie::OPimContact AbView::currentEntry()
136 currentContact = m_abTable -> currentEntry(); 136 currentContact = m_abTable -> currentEntry();
137 break; 137 break;
138 case CardView: 138 case CardView:
139 currentContact = m_ablabel -> currentEntry(); 139 currentContact = m_ablabel -> currentEntry();
140 break; 140 break;
141 } 141 }
142 m_curr_Contact = currentContact.uid(); 142 m_curr_Contact = currentContact.uid();
143 return currentContact; 143 return currentContact;
144} 144}
145 145
146bool AbView::save() 146bool AbView::save()
147{ 147{
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_curr_category == 0 ) { 160 m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName,
161 // Show unfiled 161 Opie::OPimContactAccess::FilterCategory, m_curr_category );
162 m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, 162
163 Opie::OPimContactAccess::DoNotShowWithCategory, 0 );
164 } elseif ( m_curr_category != -1 ){
165 // Just show selected category
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 );
172 }
173
174 // if ( m_curr_category != -1 ) 163 // if ( m_curr_category != -1 )
175 // clearForCategory(); 164 // clearForCategory();
176 165
177 odebug << "Number of contacts: " << m_list.count() << oendl; 166 odebug << "Number of contacts: " << m_list.count() << oendl;
178 167
179 updateView( true ); 168 updateView( true );
180 169
181} 170}
182 171
183void AbView::reload() 172void AbView::reload()
184{ 173{
185 odebug << "AbView::::reload()" << oendl; 174 odebug << "AbView::::reload()" << oendl;
186 175
187 m_contactdb->reload(); 176 m_contactdb->reload();
188 load(); 177 load();
189} 178}
190 179
191void AbView::clear() 180void AbView::clear()
192{ 181{
193 // :SX 182 // :SX
194} 183}
195 184
196void AbView::setShowByCategory( const QString& cat ) 185void AbView::setShowByCategory( const QString& cat )
197{ 186{
198 odebug << "AbView::setShowCategory( const QString& cat )" << oendl; 187 odebug << "AbView::setShowCategory( const QString& cat )" << oendl;
199 188
200 int intCat = 0; 189 int intCat = 0;
201 190
202 // All (cat == NULL) will be stored as -1 191 // Unfiled will be stored as -1
203 if ( cat.isNull() ) 192 if ( cat == tr( "Unfiled" ) )
204 intCat = -1; 193 intCat = -1;
194 else if ( cat.isNull() )
195 intCat = 0;
205 else 196 else
206 intCat = mCat.id("Contacts", cat ); 197 intCat = mCat.id("Contacts", cat );
207 198
208 // Just do anything if we really change the category 199 // Just do anything if we really change the category
209 if ( intCat != m_curr_category ){ 200 if ( intCat != m_curr_category ){
210 // odebug << "Categories: Selected " << cat << ".. Number: " 201 // odebug << "Categories: Selected " << cat << ".. Number: "
211 // << m_curr_category << oendl; 202 // << m_curr_category << oendl;
212 203
213 m_curr_category = intCat; 204 m_curr_category = intCat;
214 emit signalClearLetterPicker(); 205 emit signalClearLetterPicker();
215
216 load(); 206 load();
217 } 207 }
208 m_curr_category = intCat;
218 209
219} 210}
220 211
221void AbView::setShowToView( Views view ) 212void AbView::setShowToView( Views view )
222{ 213{
223 odebug << "void AbView::setShowToView( View " << view << " )" << oendl; 214 odebug << "void AbView::setShowToView( View " << view << " )" << oendl;
224 215
225 if ( m_curr_View != view ){ 216 if ( m_curr_View != view ){
226 odebug << "Change the View (Category is: " << m_curr_category << ")" << oendl; 217 odebug << "Change the View (Category is: " << m_curr_category << ")" << oendl;
227 m_prev_View = m_curr_View; 218 m_prev_View = m_curr_View;
228 m_curr_View = view; 219 m_curr_View = view;
229 220
230 updateView(); 221 updateView();
231 } 222 }
232 223
233} 224}
234 225
235void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) 226void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode )
236{ 227{
237 odebug << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl; 228 odebug << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl;
238 229
239 assert( mode < AbConfig::LASTELEMENT ); 230 assert( mode < AbConfig::LASTELEMENT );
240 231
241 Opie::OPimContact query; 232 Opie::OPimContact query;
242 if ( c == 0 ){ 233 if ( c == 0 ){
243 load(); 234 load();
244 return; 235 return;
245 }else{ 236 }else{
246 // If the current Backend is unable to solve the query, we will 237 // If the current Backend is unable to solve the query, we will
247 // ignore the request .. 238 // ignore the request ..
248 if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards | 239 if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards |
249 Opie::OPimContactAccess::IgnoreCase ) ){ 240 Opie::OPimContactAccess::IgnoreCase ) ){
250 owarn << "Tried to access queryByExample which is not supported by the current backend!!" << oendl; 241 owarn << "Tried to access queryByExample which is not supported by the current backend!!" << oendl;
251 owarn << "I have to ignore this access!" << oendl; 242 owarn << "I have to ignore this access!" << oendl;
252 return; 243 return;
253 } 244 }
254 245
255 switch( mode ){ 246 switch( mode ){
256 case AbConfig::LastName: 247 case AbConfig::LastName:
257 query.setLastName( QString("%1*").arg(c) ); 248 query.setLastName( QString("%1*").arg(c) );
258 break; 249 break;
259 case AbConfig::FileAs: 250 case AbConfig::FileAs:
260 query.setFileAs( QString("%1*").arg(c) ); 251 query.setFileAs( QString("%1*").arg(c) );
261 break; 252 break;
262 default: 253 default:
263 owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl 254 owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl
264 << "I will ignore it.." << oendl; 255 << "I will ignore it.." << oendl;
265 return; 256 return;
266 } 257 }
267 m_list = m_contactdb->queryByExample( query, Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ); 258 m_list = m_contactdb->queryByExample( query, Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase );
268 if ( m_curr_category != -1 ) 259
260 if ( m_curr_category != 0 )
269 clearForCategory(); 261 clearForCategory();
262
263 // Sort filtered results
264 m_list = m_contactdb->sorted( m_list, true, Opie::OPimContactAccess::SortFileAsName,
265 Opie::OPimContactAccess::FilterCategory, m_curr_category );
270 m_curr_Contact = 0; 266 m_curr_Contact = 0;
271 } 267 }
272 updateView( true ); 268 updateView( true );
273} 269}
274 270
275void AbView::setListOrder( const QValueList<int>& ordered ) 271void AbView::setListOrder( const QValueList<int>& ordered )
276{ 272{
277 m_orderedFields = ordered; 273 m_orderedFields = ordered;
278 if ( m_abTable ){ 274 if ( m_abTable ){
279 m_abTable->setOrderedList( ordered ); 275 m_abTable->setOrderedList( ordered );
280 m_abTable->refresh(); 276 m_abTable->refresh();
281 } 277 }
282 updateView(); 278 updateView();
283} 279}
284 280
285 281
286QString AbView::showCategory() const 282QString AbView::showCategory() const
287{ 283{
288 return mCat.label( "Contacts", m_curr_category ); 284 return mCat.label( "Contacts", m_curr_category );
289} 285}
290 286
291void AbView::showPersonal( bool personal ) 287void AbView::showPersonal( bool personal )
292{ 288{
293 odebug << "void AbView::showPersonal( " << personal << " )" << oendl; 289 odebug << "void AbView::showPersonal( " << personal << " )" << oendl;
@@ -357,112 +353,112 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp,
357 if ( cat.isEmpty() ) 353 if ( cat.isEmpty() )
358 category = m_curr_category; 354 category = m_curr_category;
359 else{ 355 else{
360 category = mCat.id("Contacts", cat ); 356 category = mCat.id("Contacts", cat );
361 } 357 }
362 358
363 //odebug << "Find in Category " << category << oendl; 359 //odebug << "Find in Category " << category << oendl;
364 360
365 QRegExp r( str ); 361 QRegExp r( str );
366 r.setCaseSensitive( caseSensitive ); 362 r.setCaseSensitive( caseSensitive );
367 r.setWildcard( !useRegExp ); 363 r.setWildcard( !useRegExp );
368 364
369 // Get all matching entries out of the database 365 // Get all matching entries out of the database
370 m_list = m_contactdb->matchRegexp( r ); 366 m_list = m_contactdb->matchRegexp( r );
371 367
372 //odebug << "Found: " << m_list.count() << oendl; 368 //odebug << "Found: " << m_list.count() << oendl;
373 if ( m_list.count() == 0 ){ 369 if ( m_list.count() == 0 ){
374 emit signalNotFound(); 370 emit signalNotFound();
375 return; 371 return;
376 } 372 }
377 373
378 // Now remove all contacts with wrong category (if any selected) 374 // Now remove all contacts with wrong category (if any selected)
379 // This algorithm is a litte bit ineffective, but 375 // This algorithm is a litte bit ineffective, but
380 // we will not have a lot of matching entries.. 376 // we will not have a lot of matching entries..
381 if ( m_curr_category != -1 ) 377 if ( m_curr_category != 0 )
382 clearForCategory(); 378 clearForCategory();
383 379
384 // Now show all found entries 380 // Now show all found entries
385 updateView( true ); 381 updateView( true );
386} 382}
387 383
388void AbView::offSearch() 384void AbView::offSearch()
389{ 385{
390 m_inSearch = false; 386 m_inSearch = false;
391 387
392 load(); 388 load();
393} 389}
394 390
395void AbView::slotSwitch(){ 391void AbView::slotSwitch(){
396 //odebug << "AbView::slotSwitch()" << oendl; 392 //odebug << "AbView::slotSwitch()" << oendl;
397 393
398 m_prev_View = m_curr_View; 394 m_prev_View = m_curr_View;
399 switch ( (int) m_curr_View ){ 395 switch ( (int) m_curr_View ){
400 case TableView: 396 case TableView:
401 odebug << "Switching to CardView" << oendl; 397 odebug << "Switching to CardView" << oendl;
402 m_curr_View = CardView; 398 m_curr_View = CardView;
403 break; 399 break;
404 case CardView: 400 case CardView:
405 odebug << "Switching to TableView" << oendl; 401 odebug << "Switching to TableView" << oendl;
406 m_curr_View = TableView; 402 m_curr_View = TableView;
407 break; 403 break;
408 } 404 }
409 updateView(); 405 updateView();
410 406
411} 407}
412 408
413// END: Slots 409// END: Slots
414 410
415void AbView::clearForCategory() 411void AbView::clearForCategory()
416{ 412{
417 Opie::OPimContactAccess::List::Iterator it; 413 Opie::OPimContactAccess::List::Iterator it;
418 // Now remove all contacts with wrong category if any category selected 414 // Now remove all contacts with wrong category if any category selected
419 415
420 Opie::OPimContactAccess::List allList = m_list; 416 Opie::OPimContactAccess::List allList = m_list;
421 if ( m_curr_category != -1 ){ 417 if ( m_curr_category != 0 ){
422 for ( it = allList.begin(); it != allList.end(); ++it ){ 418 for ( it = allList.begin(); it != allList.end(); ++it ){
423 if ( !contactCompare( *it, m_curr_category ) ){ 419 if ( !contactCompare( *it, m_curr_category ) ){
424 //odebug << "Removing " << (*it).uid() << oendl; 420 //odebug << "Removing " << (*it).uid() << oendl;
425 m_list.remove( (*it).uid() ); 421 m_list.remove( (*it).uid() );
426 } 422 }
427 } 423 }
428 } 424 }
429 425
430} 426}
431 427
432bool AbView::contactCompare( const Opie::OPimContact &cnt, int category ) 428bool AbView::contactCompare( const Opie::OPimContact &cnt, int category )
433{ 429{
434 //odebug << "bool AbView::contactCompare( const Opie::OPimContact &cnt, " 430 //odebug << "bool AbView::contactCompare( const Opie::OPimContact &cnt, "
435 // << category << " )" << oendl; 431 // << category << " )" << oendl;
436 432
437 bool returnMe; 433 bool returnMe;
438 QArray<int> cats; 434 QArray<int> cats;
439 cats = cnt.categories(); 435 cats = cnt.categories();
440 436
441 //odebug << "Number of categories: " << cats.count() << oendl; 437 //odebug << "Number of categories: " << cats.count() << oendl;
442 438
443 returnMe = false; 439 returnMe = false;
444 if ( cats.count() == 0 && category == 0 ) 440 if ( cats.count() == 0 && category == -1 )
445 // Contacts with no category will just shown on "All" and "Unfiled" 441 // Contacts with no category will just shown on "All" and "Unfiled"
446 returnMe = true; 442 returnMe = true;
447 else { 443 else {
448 int i; 444 int i;
449 for ( i = 0; i < int(cats.count()); i++ ) { 445 for ( i = 0; i < int(cats.count()); i++ ) {
450 //odebug << "Comparing " << cats[i] << " with " << category << oendl; 446 //odebug << "Comparing " << cats[i] << " with " << category << oendl;
451 if ( cats[i] == category ) { 447 if ( cats[i] == category ) {
452 returnMe = true; 448 returnMe = true;
453 break; 449 break;
454 } 450 }
455 } 451 }
456 } 452 }
457 //odebug << "Return: " << returnMe << oendl; 453 //odebug << "Return: " << returnMe << oendl;
458 return returnMe; 454 return returnMe;
459} 455}
460 456
461// In Some rare cases we have to update all lists.. 457// In Some rare cases we have to update all lists..
462void AbView::updateListinViews() 458void AbView::updateListinViews()
463{ 459{
464 m_abTable -> setContacts( m_list ); 460 m_abTable -> setContacts( m_list );
465 m_ablabel -> setContacts( m_list ); 461 m_ablabel -> setContacts( m_list );
466} 462}
467 463
468void AbView::updateView( bool newdata ) 464void AbView::updateView( bool newdata )
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 6984501..faae0a9 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -833,50 +833,53 @@ void AddressbookWindow::slotSave()
833 833
834 834
835void AddressbookWindow::slotNotFound() 835void AddressbookWindow::slotNotFound()
836{ 836{
837 odebug << "Got not found signal!" << oendl; 837 odebug << "Got not found signal!" << oendl;
838 QMessageBox::information( this, tr( "Not Found" ), 838 QMessageBox::information( this, tr( "Not Found" ),
839 "<qt>" + tr( "Unable to find a contact for this search pattern!" ) + "</qt>" ); 839 "<qt>" + tr( "Unable to find a contact for this search pattern!" ) + "</qt>" );
840 840
841 841
842} 842}
843void AddressbookWindow::slotWrapAround() 843void AddressbookWindow::slotWrapAround()
844{ 844{
845 odebug << "Got wrap signal!" << oendl; 845 odebug << "Got wrap signal!" << oendl;
846 // if ( doNotifyWrapAround ) 846 // if ( doNotifyWrapAround )
847 // QMessageBox::information( this, tr( "End of list" ), 847 // QMessageBox::information( this, tr( "End of list" ),
848 // tr( "End of list. Wrap around now...!" ) + "\n" ); 848 // tr( "End of list. Wrap around now...!" ) + "\n" );
849 849
850} 850}
851 851
852void AddressbookWindow::slotSetCategory( const QString &category ) 852void AddressbookWindow::slotSetCategory( const QString &category )
853{ 853{
854 odebug << "void AddressbookWindow::slotSetCategory( " << category << " )" << oendl; 854 odebug << "void AddressbookWindow::slotSetCategory( " << category << " )" << oendl;
855 855
856 // Tell the view about the selected category 856 // Tell the view about the selected category
857 m_config.setCategory( category ); 857 QString cat = category;
858 m_abView -> setShowByCategory( category ); 858 if ( cat == tr( "All" ) )
859 cat = QString::null;
860 m_config.setCategory( cat );
861 m_abView -> setShowByCategory( cat );
859} 862}
860 863
861void AddressbookWindow::slotViewSwitched( int view ) 864void AddressbookWindow::slotViewSwitched( int view )
862{ 865{
863 odebug << "void AddressbookWindow::slotViewSwitched( " << view << " )" << oendl; 866 odebug << "void AddressbookWindow::slotViewSwitched( " << view << " )" << oendl;
864 867
865 // Tell the view about the selected view 868 // Tell the view about the selected view
866 m_abView -> setShowToView ( (AbView::Views) view ); 869 m_abView -> setShowToView ( (AbView::Views) view );
867 active_view = view; 870 active_view = view;
868} 871}
869 872
870 873
871void AddressbookWindow::slotListView() 874void AddressbookWindow::slotListView()
872{ 875{
873 slotViewSwitched( AbView::TableView ); 876 slotViewSwitched( AbView::TableView );
874} 877}
875 878
876void AddressbookWindow::slotCardView() 879void AddressbookWindow::slotCardView()
877{ 880{
878 slotViewSwitched( AbView::CardView ); 881 slotViewSwitched( AbView::CardView );
879} 882}
880 883
881void AddressbookWindow::slotSetLetter( char c ) { 884void AddressbookWindow::slotSetLetter( char c ) {
882 885