Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abview.cpp | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 0f4bd5f..7226e82 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -126,11 +126,14 @@ OContact AbView::currentEntry() | |||
126 | { | 126 | { |
127 | OContact currentContact; | ||
128 | |||
127 | switch ( (int) m_curr_View ) { | 129 | switch ( (int) m_curr_View ) { |
128 | case TableView: | 130 | case TableView: |
129 | return ( m_abTable -> currentEntry() ); | 131 | currentContact = m_abTable -> currentEntry(); |
130 | break; | 132 | break; |
131 | case CardView: | 133 | case CardView: |
132 | return ( m_ablabel -> currentEntry() ); | 134 | currentContact = m_ablabel -> currentEntry(); |
133 | break; | 135 | break; |
134 | } | 136 | } |
135 | return OContact(); | 137 | m_curr_Contact = currentContact.uid(); |
138 | return currentContact; | ||
136 | } | 139 | } |
@@ -147,2 +150,5 @@ void AbView::load() | |||
147 | qWarning("abView:Load data"); | 150 | qWarning("abView:Load data"); |
151 | |||
152 | // Letter Search is stopped at this place | ||
153 | emit signalClearLetterPicker(); | ||
148 | 154 | ||
@@ -150,6 +156,6 @@ void AbView::load() | |||
150 | m_list = m_contactdb->allRecords(); | 156 | m_list = m_contactdb->allRecords(); |
151 | else | 157 | else{ |
152 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); | 158 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); |
153 | 159 | clearForCategory(); | |
154 | clearForCategory(); | 160 | } |
155 | 161 | ||
@@ -157,3 +163,3 @@ void AbView::load() | |||
157 | 163 | ||
158 | updateView(); | 164 | updateView( true ); |
159 | 165 | ||
@@ -226,3 +232,3 @@ void AbView::setShowByLetter( char c ) | |||
226 | } | 232 | } |
227 | updateView(); | 233 | updateView( true ); |
228 | } | 234 | } |
@@ -327,3 +333,3 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, | |||
327 | // Now show all found entries | 333 | // Now show all found entries |
328 | updateView(); | 334 | updateView( true ); |
329 | } | 335 | } |
@@ -409,3 +415,3 @@ void AbView::updateListinViews() | |||
409 | 415 | ||
410 | void AbView::updateView() | 416 | void AbView::updateView( bool newdata ) |
411 | { | 417 | { |
@@ -418,18 +424,21 @@ void AbView::updateView() | |||
418 | // If we switching the view, we have to store some information | 424 | // If we switching the view, we have to store some information |
419 | if ( m_list.count() ){ | 425 | if ( !newdata ){ |
420 | switch ( (int) m_prev_View ) { | 426 | if ( m_list.count() ){ |
421 | case TableView: | 427 | switch ( (int) m_prev_View ) { |
422 | m_curr_Contact = m_abTable -> currentEntry_UID(); | 428 | case TableView: |
423 | break; | 429 | m_curr_Contact = m_abTable -> currentEntry_UID(); |
424 | case CardView: | 430 | break; |
425 | m_curr_Contact = m_ablabel -> currentEntry_UID(); | 431 | case CardView: |
426 | break; | 432 | m_curr_Contact = m_ablabel -> currentEntry_UID(); |
427 | } | 433 | break; |
428 | }else | 434 | } |
429 | m_curr_Contact = 0; | 435 | }else |
436 | m_curr_Contact = 0; | ||
437 | } | ||
430 | 438 | ||
431 | // Feed all views with new lists | 439 | // Feed all views with new lists |
432 | updateListinViews(); | 440 | if ( newdata ) |
441 | updateListinViews(); | ||
433 | 442 | ||
434 | // Inform the world that the view is changed | 443 | // Tell the world that the view is changed |
435 | if ( m_curr_View != m_prev_View ) | 444 | if ( m_curr_View != m_prev_View ) |