summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/abview.cpp14
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
@@ -37,16 +37,17 @@ 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 ),
m_viewStack( 0l ),
m_abTable( 0l ),
@@ -75,16 +76,18 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ):
// Create CardView and add it to WidgetStack
QVBox* cardBox = new QVBox( m_viewStack );
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();
}
AbView::~AbView()
{
@@ -156,25 +159,25 @@ void AbView::load()
// Letter Search is stopped at this place
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 );
}
@@ -411,16 +414,21 @@ void AbView::slotSwitch(){
odebug << "Switching to TableView" << oendl;
m_curr_View = TableView;
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
Opie::OPimContactAccess::List allList = m_list;