-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 8 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 2 |
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 @@ -742,17 +742,21 @@ void AddressbookWindow::flush() { syncing = TRUE; m_abView->save(); } void AddressbookWindow::closeEvent( QCloseEvent *e ) { - + if(active_view == AbView::CardView){ + slotViewSwitched( AbView::TableView ); + e->ignore(); + return; + } if(syncing) { /* shouldn't we save, I hear you say? well its already been set so that an edit can not occur during a sync, and we flushed at the start of the sync, so there is no need to save Saving however itself would cause problems. */ e->accept(); return; } @@ -889,17 +893,17 @@ void AddressbookWindow::slotViewSwitched( int view ) } for ( unsigned int i = 1; i < 3; i++ ){ if ( catMenu ) catMenu->setItemChecked( i, menu == (int)i ); } // Tell the view about the selected view m_abView -> setShowToView ( (AbView::Views) view ); - + active_view = view; } void AddressbookWindow::slotListView() { 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 @@ -127,11 +127,13 @@ private: int m_curFontSize; bool isLoading; AbConfig m_config; QAction* m_tableViewButton; QAction* m_cardViewButton; + + int active_view; }; #endif |