author | eilers <eilers> | 2005-03-24 16:23:51 (UTC) |
---|---|---|
committer | eilers <eilers> | 2005-03-24 16:23:51 (UTC) |
commit | b390bcd32e188fc3c9fd7067bfc41b60b5e84ad4 (patch) (side-by-side diff) | |
tree | 38bc784605eb06a6669e8708c86cc9cebaa32b2a /core/pim/addressbook/abview.cpp | |
parent | 29da9a4477210843435cbea3ede0d520775fe1a5 (diff) | |
download | opie-b390bcd32e188fc3c9fd7067bfc41b60b5e84ad4.zip opie-b390bcd32e188fc3c9fd7067bfc41b60b5e84ad4.tar.gz opie-b390bcd32e188fc3c9fd7067bfc41b60b5e84ad4.tar.bz2 |
In table view: Clicking on column 0 changes the sortorder.
Version of ths app was changed to 1.2.0
Requested by #1591
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/abview.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 8a2db96..9f7f71f 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp @@ -39,12 +39,13 @@ QString addressbookPersonalVCardName() AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): QWidget(parent), mCat(0), m_inSearch( false ), m_inPersonal( false ), + m_sortOrder( true ), m_curr_category( 0 ), m_curr_View( TableView ), m_prev_View( TableView ), m_curr_Contact ( 0 ), m_contactdb ( 0l ), m_storedDB ( 0l ), @@ -77,12 +78,14 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): m_ablabel = new AbLabel( cardBox, "CardView"); m_viewStack -> addWidget( cardBox , CardView ); // Connect views to me connect ( m_abTable, SIGNAL( signalSwitch(void) ), this, SLOT( slotSwitch(void) ) ); + connect ( m_abTable, SIGNAL( signalSortOrderChanged( bool ) ), + this, SLOT( slotSetSortOrder( bool ) ) ); connect ( m_ablabel, SIGNAL( signalOkPressed(void) ), this, SLOT( slotSwitch(void) ) ); load(); } @@ -158,21 +161,21 @@ void AbView::load() emit signalClearLetterPicker(); odebug << "selected Category: " << m_curr_category << oendl; if ( m_curr_category == -1 ) { // Show just unfiled contacts - m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, + m_list = m_contactdb->sorted( m_sortOrder, Opie::OPimContactAccess::SortFileAsName, Opie::OPimContactAccess::DoNotShowWithCategory, 0 ); } else if ( m_curr_category == 0 ){ // Just show all contacts - m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, + m_list = m_contactdb->sorted( m_sortOrder, Opie::OPimContactAccess::SortFileAsName, Opie::OPimBase::FilterOff, 0 ); } else { // Show contacts with given categories - m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, + m_list = m_contactdb->sorted( m_sortOrder, Opie::OPimContactAccess::SortFileAsName, Opie::OPimBase::FilterCategory, m_curr_category ); } odebug << "Number of contacts: " << m_list.count() << oendl; updateView( true ); @@ -413,12 +416,17 @@ void AbView::slotSwitch(){ break; } updateView(); } +void AbView::slotSetSortOrder( bool order ){ + m_sortOrder = order; + reload(); +} + // END: Slots void AbView::clearForCategory() { Opie::OPimContactAccess::List::Iterator it; // Now remove all contacts with wrong category if any category selected |