summaryrefslogtreecommitdiff
path: root/core/pim/addressbook
Unidiff
Diffstat (limited to 'core/pim/addressbook') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp8
-rw-r--r--core/pim/addressbook/addressbook.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 055124c..60db2b4 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -744,13 +744,17 @@ void AddressbookWindow::flush()
744 m_abView->save(); 744 m_abView->save();
745} 745}
746 746
747 747
748void AddressbookWindow::closeEvent( QCloseEvent *e ) 748void AddressbookWindow::closeEvent( QCloseEvent *e )
749{ 749{
750 750 if(active_view == AbView::CardView){
751 slotViewSwitched( AbView::TableView );
752 e->ignore();
753 return;
754 }
751 if(syncing) { 755 if(syncing) {
752 /* shouldn't we save, I hear you say? well its already been set 756 /* shouldn't we save, I hear you say? well its already been set
753 so that an edit can not occur during a sync, and we flushed 757 so that an edit can not occur during a sync, and we flushed
754 at the start of the sync, so there is no need to save 758 at the start of the sync, so there is no need to save
755 Saving however itself would cause problems. */ 759 Saving however itself would cause problems. */
756 e->accept(); 760 e->accept();
@@ -891,13 +895,13 @@ void AddressbookWindow::slotViewSwitched( int view )
891 if ( catMenu ) 895 if ( catMenu )
892 catMenu->setItemChecked( i, menu == (int)i ); 896 catMenu->setItemChecked( i, menu == (int)i );
893 } 897 }
894 898
895 // Tell the view about the selected view 899 // Tell the view about the selected view
896 m_abView -> setShowToView ( (AbView::Views) view ); 900 m_abView -> setShowToView ( (AbView::Views) view );
897 901 active_view = view;
898} 902}
899 903
900 904
901void AddressbookWindow::slotListView() 905void AddressbookWindow::slotListView()
902{ 906{
903 slotViewSwitched( AbView::TableView ); 907 slotViewSwitched( AbView::TableView );
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h
index 4c1e2f2..2bedc0b 100644
--- a/core/pim/addressbook/addressbook.h
+++ b/core/pim/addressbook/addressbook.h
@@ -129,9 +129,11 @@ private:
129 bool isLoading; 129 bool isLoading;
130 130
131 AbConfig m_config; 131 AbConfig m_config;
132 132
133 QAction* m_tableViewButton; 133 QAction* m_tableViewButton;
134 QAction* m_cardViewButton; 134 QAction* m_cardViewButton;
135
136 int active_view;
135}; 137};
136 138
137#endif 139#endif