summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp46
1 files changed, 18 insertions, 28 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 3b2e4b8..5d588da 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -823,8 +823,10 @@ void AddressbookWindow::slotSetCategory( int c )
- // Checkmark Book Menu Item Selected
+ // Switch view
if ( c < 3 )
- for ( unsigned int i = 1; i < 3; i++ )
- catMenu->setItemChecked( i, c == (int)i );
- // Checkmark Category Menu Item Selected
+ for ( unsigned int i = 1; i < 3; i++ ){
+ if ( catMenu )
+ catMenu->setItemChecked( i, c == (int)i );
+ }
else
+ // Checkmark Category Menu Item Selected
for ( unsigned int i = 3; i < catMenu->count(); i++ )
@@ -832,2 +834,3 @@ void AddressbookWindow::slotSetCategory( int c )
+ // Now switch to the selected category
for ( unsigned int i = 1; i < catMenu->count(); i++ ) {
@@ -854,5 +857,7 @@ void AddressbookWindow::slotSetCategory( int c )
+ // Switch to the selected View
slotViewSwitched( view );
- m_abView -> setShowByCategory( view, cat );
+ // Tell the view about the selected category
+ m_abView -> setShowByCategory( cat );
@@ -870,2 +875,4 @@ void AddressbookWindow::slotViewSwitched( int view )
int menu = 0;
+
+ // Switch to selected view
switch ( view ){
@@ -881,11 +888,2 @@ void AddressbookWindow::slotViewSwitched( int view )
break;
-// case AbView::PersonalView:
-// menu = 3;
-// break;
-// case AbView::CompanyBook:
-// menu = 3;
-// break;
-// case AbView::EmailBook:
-// menu = 4;
-// break;
}
@@ -895,2 +893,6 @@ void AddressbookWindow::slotViewSwitched( int view )
}
+
+ // Tell the view about the selected view
+ m_abView -> setShowToView ( (AbView::Views) view );
+
}
@@ -900,3 +902,3 @@ void AddressbookWindow::slotListView()
{
- emit slotSetCategory( AbView::TableView +1 );
+ slotViewSwitched( AbView::TableView );
}
@@ -905,3 +907,3 @@ void AddressbookWindow::slotCardView()
{
- emit slotSetCategory( AbView::CardView +1 );
+ slotViewSwitched( AbView::CardView );
}
@@ -939,14 +941,2 @@ void AddressbookWindow::populateCategories()
- // :SX
-// if ( abList->showBook().isEmpty() ) {
-// catMenu->setItemChecked( 1, true );
-// } else if ( abList->showBook() == "Phone" ) {
-// catMenu->setItemChecked( 2, true );
-// } else if ( abList->showBook() == "Company" ) {
-// catMenu->setItemChecked( 3, true );
-// } else if ( abList->showBook() == "Email" ) {
-// catMenu->setItemChecked( 4, true );
-// } else if ( abList->showBook() == "Cards" ) {
-// catMenu->setItemChecked( 5, true );
-// }