summaryrefslogtreecommitdiff
authoreilers <eilers>2002-11-28 11:50:57 (UTC)
committer eilers <eilers>2002-11-28 11:50:57 (UTC)
commitadc6c4f994dc38ff287cb03a73933816108ba47b (patch) (unidiff)
tree7a07bb017ec7a0db0888c48b3092904ffc39ba9b
parent0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a (diff)
downloadopie-adc6c4f994dc38ff287cb03a73933816108ba47b.zip
opie-adc6c4f994dc38ff287cb03a73933816108ba47b.tar.gz
opie-adc6c4f994dc38ff287cb03a73933816108ba47b.tar.bz2
Change of view caused jump to the first line of table->fixed
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abview.cpp6
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
@@ -390,68 +390,68 @@ bool AbView::contactCompare( const OContact &cnt, int category )
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..
404void AbView::updateListinViews() 404void 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
410void AbView::updateView() 410void 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}