-rw-r--r-- | core/pim/addressbook/abtable.cpp | 13 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.h | 4 | ||||
-rw-r--r-- | core/pim/addressbook/abview.cpp | 4 |
3 files changed, 19 insertions, 2 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index a829dc2..a2617fa 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -177,16 +177,22 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) resort(); updateVisible(); setPaintingEnabled( TRUE ); } +void AbTable::setOrderedList( const QValueList<int> ordered ) +{ + intFields = ordered; +} + + bool AbTable::selectContact( int UID ) { // qWarning( "AbTable::selectContact( %d )", UID ); int rows = numRows(); AbTableItem *abi; OContact* foundContact = 0l; bool found = false; @@ -312,20 +318,23 @@ void AbTable::refresh() AbTableItem *abi; ContactItem contactItem; setPaintingEnabled( FALSE ); for ( int r = 0; r < rows; ++r ) { abi = static_cast<AbTableItem*>( item(r, 0) ); contactItem = findContactContact( contactList[abi], r ); static_cast<AbTableItem*>( item(r, 1) )->setItem( contactItem.value, abi->text() ); - if ( !contactItem.icon.isNull() ) + if ( !contactItem.icon.isNull() ){ static_cast<AbTableItem*>( item(r, 1) )-> setPixmap( contactItem.icon ); - + }else{ + static_cast<AbTableItem*>( item(r, 1) )-> + setPixmap( QPixmap() ); + } } resort(); setPaintingEnabled( TRUE ); } void AbTable::keyPressEvent( QKeyEvent *e ) { char key = toupper( e->ascii() ); diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index 4e6b294..0f7bc29 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h @@ -73,16 +73,20 @@ class AbTable : public QTable Q_OBJECT public: AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); ~AbTable(); // Set the contacts shown in the table void setContacts( const OContactAccess::List& viewList ); + + // Set the list for primary contacts + void setOrderedList( const QValueList<int> ordered ); + // Selects a contact of a specific UID bool selectContact( int UID ); // Get the current selected entry OContact currentEntry(); // Get the UID of the current selected Entry int currentEntry_UID(); diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 7da0992..b89b794 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp @@ -238,16 +238,20 @@ void AbView::setShowByLetter( char c ) m_curr_Contact = 0; } updateView( true ); } void AbView::setListOrder( const QValueList<int>& ordered ) { m_orderedFields = ordered; + if ( m_abTable ){ + m_abTable->setOrderedList( ordered ); + m_abTable->refresh(); + } updateView(); } QString AbView::showCategory() const { return mCat.label( "Contacts", m_curr_category ); } |