Diffstat (limited to 'core/pim/addressbook/ablabel.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/ablabel.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/pim/addressbook/ablabel.cpp b/core/pim/addressbook/ablabel.cpp index 6d8de91..1914f71 100644 --- a/core/pim/addressbook/ablabel.cpp +++ b/core/pim/addressbook/ablabel.cpp @@ -62,28 +62,31 @@ int AbLabel::currentEntry_UID() OContact AbLabel::currentEntry() { if ( ! m_empty ) return ( *m_itCurContact ); else return OContact(); } bool AbLabel::selectContact( int UID ) { - for ( m_itCurContact = m_viewList.begin(); m_itCurContact != m_viewList.end(); ++m_itCurContact){ - if ( (*m_itCurContact).uid() == UID ) + for ( int r = 0; r < m_viewList.count(); ++r ) { + if ( m_viewList.uidAt( r ) == UID ){ + m_itCurContact.setCurrent( r ); break; } + } + sync(); return true; } void AbLabel::sync() { QString text = (*m_itCurContact).toRichText(); setText( text ); } |