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.cpp55
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
@@ -125,13 +125,16 @@ void AbView::replaceEntry( const OContact &contact )
125OContact AbView::currentEntry() 125OContact 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}
137 140
@@ -146,15 +149,18 @@ void AbView::load()
146{ 149{
147 qWarning("abView:Load data"); 150 qWarning("abView:Load data");
151
152 // Letter Search is stopped at this place
153 emit signalClearLetterPicker();
148 154
149 if ( m_inPersonal ) 155 if ( m_inPersonal )
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
156 qWarning ("Number of contacts: %d", m_list.count()); 162 qWarning ("Number of contacts: %d", m_list.count());
157 163
158 updateView(); 164 updateView( true );
159 165
160} 166}
@@ -225,5 +231,5 @@ void AbView::setShowByLetter( char c )
225 m_curr_Contact = 0; 231 m_curr_Contact = 0;
226 } 232 }
227 updateView(); 233 updateView( true );
228} 234}
229 235
@@ -326,5 +332,5 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp,
326 332
327 // Now show all found entries 333 // Now show all found entries
328 updateView(); 334 updateView( true );
329} 335}
330 336
@@ -408,5 +414,5 @@ void AbView::updateListinViews()
408} 414}
409 415
410void AbView::updateView() 416void AbView::updateView( bool newdata )
411{ 417{
412 qWarning("AbView::updateView()"); 418 qWarning("AbView::updateView()");
@@ -417,20 +423,23 @@ void AbView::updateView()
417 423
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 )
436 emit signalViewSwitched ( (int) m_curr_View ); 445 emit signalViewSwitched ( (int) m_curr_View );