-rw-r--r-- | core/pim/addressbook/abview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 3af7663..0f4bd5f 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -366,94 +366,94 @@ void AbView::clearForCategory() | |||
366 | if ( !contactCompare( *it, m_curr_category ) ){ | 366 | if ( !contactCompare( *it, m_curr_category ) ){ |
367 | qWarning("Removing %d", (*it).uid()); | 367 | qWarning("Removing %d", (*it).uid()); |
368 | m_list.remove( (*it).uid() ); | 368 | m_list.remove( (*it).uid() ); |
369 | } | 369 | } |
370 | } | 370 | } |
371 | } | 371 | } |
372 | 372 | ||
373 | } | 373 | } |
374 | 374 | ||
375 | bool AbView::contactCompare( const OContact &cnt, int category ) | 375 | bool AbView::contactCompare( const OContact &cnt, int category ) |
376 | { | 376 | { |
377 | qWarning ("bool AbView::contactCompare( const OContact &cnt, %d )", category); | 377 | qWarning ("bool AbView::contactCompare( const OContact &cnt, %d )", category); |
378 | 378 | ||
379 | bool returnMe; | 379 | bool returnMe; |
380 | QArray<int> cats; | 380 | QArray<int> cats; |
381 | cats = cnt.categories(); | 381 | cats = cnt.categories(); |
382 | 382 | ||
383 | qWarning ("Number of categories: %d", cats.count() ); | 383 | qWarning ("Number of categories: %d", cats.count() ); |
384 | 384 | ||
385 | returnMe = false; | 385 | returnMe = false; |
386 | if ( cats.count() == 0 && category == 0 ) | 386 | if ( cats.count() == 0 && category == 0 ) |
387 | // Contacts with no category will just shown on "All" and "Unfiled" | 387 | // Contacts with no category will just shown on "All" and "Unfiled" |
388 | returnMe = true; | 388 | returnMe = true; |
389 | else { | 389 | else { |
390 | int i; | 390 | int i; |
391 | for ( i = 0; i < int(cats.count()); i++ ) { | 391 | for ( i = 0; i < int(cats.count()); i++ ) { |
392 | qWarning("Comparing %d with %d",cats[i],category ); | 392 | qWarning("Comparing %d with %d",cats[i],category ); |
393 | if ( cats[i] == category ) { | 393 | if ( cats[i] == category ) { |
394 | returnMe = true; | 394 | returnMe = true; |
395 | break; | 395 | break; |
396 | } | 396 | } |
397 | } | 397 | } |
398 | } | 398 | } |
399 | qWarning ("Return: %d", returnMe); | 399 | qWarning ("Return: %d", returnMe); |
400 | return returnMe; | 400 | return returnMe; |
401 | } | 401 | } |
402 | 402 | ||
403 | // In Some rare cases we have to update all lists.. | 403 | // In Some rare cases we have to update all lists.. |
404 | void AbView::updateListinViews() | 404 | void AbView::updateListinViews() |
405 | { | 405 | { |
406 | m_abTable -> setContacts( m_list ); | 406 | m_abTable -> setContacts( m_list ); |
407 | m_ablabel -> setContacts( m_list ); | 407 | m_ablabel -> setContacts( m_list ); |
408 | } | 408 | } |
409 | 409 | ||
410 | void AbView::updateView() | 410 | void AbView::updateView() |
411 | { | 411 | { |
412 | qWarning("AbView::updateView()"); | 412 | qWarning("AbView::updateView()"); |
413 | 413 | ||
414 | // Feed all views with new lists | ||
415 | updateListinViews(); | ||
416 | |||
417 | if ( m_viewStack -> visibleWidget() ){ | 414 | if ( m_viewStack -> visibleWidget() ){ |
418 | m_viewStack -> visibleWidget() -> clearFocus(); | 415 | m_viewStack -> visibleWidget() -> clearFocus(); |
419 | } | 416 | } |
420 | 417 | ||
421 | // If we switching the view, we have to store some information | 418 | // If we switching the view, we have to store some information |
422 | if ( m_list.count() ){ | 419 | if ( m_list.count() ){ |
423 | switch ( (int) m_prev_View ) { | 420 | switch ( (int) m_prev_View ) { |
424 | case TableView: | 421 | case TableView: |
425 | m_curr_Contact = m_abTable -> currentEntry_UID(); | 422 | m_curr_Contact = m_abTable -> currentEntry_UID(); |
426 | break; | 423 | break; |
427 | case CardView: | 424 | case CardView: |
428 | m_curr_Contact = m_ablabel -> currentEntry_UID(); | 425 | m_curr_Contact = m_ablabel -> currentEntry_UID(); |
429 | break; | 426 | break; |
430 | } | 427 | } |
431 | }else | 428 | }else |
432 | m_curr_Contact = 0; | 429 | m_curr_Contact = 0; |
433 | 430 | ||
431 | // Feed all views with new lists | ||
432 | updateListinViews(); | ||
433 | |||
434 | // Inform the world that the view is changed | 434 | // Inform the world that the view is changed |
435 | if ( m_curr_View != m_prev_View ) | 435 | if ( m_curr_View != m_prev_View ) |
436 | emit signalViewSwitched ( (int) m_curr_View ); | 436 | emit signalViewSwitched ( (int) m_curr_View ); |
437 | 437 | ||
438 | m_prev_View = m_curr_View; | 438 | m_prev_View = m_curr_View; |
439 | 439 | ||
440 | // Switch to new View | 440 | // Switch to new View |
441 | switch ( (int) m_curr_View ) { | 441 | switch ( (int) m_curr_View ) { |
442 | case TableView: | 442 | case TableView: |
443 | m_abTable -> setChoiceSelection( m_orderedFields ); | 443 | m_abTable -> setChoiceSelection( m_orderedFields ); |
444 | if ( m_curr_Contact != 0 ) | 444 | if ( m_curr_Contact != 0 ) |
445 | m_abTable -> selectContact ( m_curr_Contact ); | 445 | m_abTable -> selectContact ( m_curr_Contact ); |
446 | m_abTable -> setFocus(); | 446 | m_abTable -> setFocus(); |
447 | break; | 447 | break; |
448 | case CardView: | 448 | case CardView: |
449 | if ( m_curr_Contact != 0 ) | 449 | if ( m_curr_Contact != 0 ) |
450 | m_ablabel -> selectContact( m_curr_Contact ); | 450 | m_ablabel -> selectContact( m_curr_Contact ); |
451 | m_ablabel -> setFocus(); | 451 | m_ablabel -> setFocus(); |
452 | break; | 452 | break; |
453 | } | 453 | } |
454 | 454 | ||
455 | // Raise the current View | 455 | // Raise the current View |
456 | m_viewStack -> raiseWidget( m_curr_View ); | 456 | m_viewStack -> raiseWidget( m_curr_View ); |
457 | } | 457 | } |
458 | 458 | ||
459 | 459 | ||