author | eilers <eilers> | 2002-11-27 15:21:06 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-11-27 15:21:06 (UTC) |
commit | 4b20972da142bbdea42c682025ab5303c35a5a92 (patch) (side-by-side diff) | |
tree | 934acaec747a495188a7d3c1e125ecc0776b68c6 /core/pim/addressbook/abview.cpp | |
parent | 4d7272423782dc2f9f7dbde36b848f55eb323c79 (diff) | |
download | opie-4b20972da142bbdea42c682025ab5303c35a5a92.zip opie-4b20972da142bbdea42c682025ab5303c35a5a92.tar.gz opie-4b20972da142bbdea42c682025ab5303c35a5a92.tar.bz2 |
Extremely improved table update
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abview.cpp | 72 |
1 files changed, 43 insertions, 29 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 8d22129..3af7663 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp @@ -1,2 +1,18 @@ +/********************************************************************** +** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) +** +** This file is part of Qt Palmtop Environment. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** +**********************************************************************/ + #include "abview.h" @@ -138,7 +154,4 @@ void AbView::load() clearForCategory(); - // Feed all views with new lists - updateListinViews(); - qWarning ("Number of contacts: %d", m_list.count()); @@ -160,18 +173,7 @@ void AbView::clear() } -void AbView::setShowByCategory( Views view, const QString& cat ) +void AbView::setShowByCategory( const QString& cat ) { - qWarning("AbView::setShowCategory( Views view, const QString& cat )"); - -// if ( view == PersonalView ){ -// if ( ! m_inPersonal ) -// showPersonal( true ); - -// }else{ -// if ( m_inPersonal ) -// showPersonal( false ); - -// m_curr_View = view; -// } + qWarning("AbView::setShowCategory( const QString& cat )"); int intCat = 0; @@ -183,16 +185,8 @@ void AbView::setShowByCategory( Views view, const QString& cat ) intCat = mCat.id("Contacts", cat ); - // If we just change the view, we don't have to reload any data.. - // This speeds up a lot of things ! - if ( intCat == m_curr_category ){ - qWarning ("Just change the View (Category is: %d)", m_curr_category); - m_prev_View = m_curr_View; - m_curr_View = view; - - updateView(); - }else{ + // Just do anything if we really change the category + if ( intCat != m_curr_category ){ qWarning ("Categories: Selected %s.. Number: %d", cat.latin1(), m_curr_category); - m_curr_View = view; m_curr_category = intCat; emit signalClearLetterPicker(); @@ -202,4 +196,20 @@ void AbView::setShowByCategory( Views view, const QString& cat ) } + +void AbView::setShowToView( Views view ) +{ + qWarning("void AbView::setShowToView( View %d )", view); + + qWarning ("Change the View (Category is: %d)", m_curr_category); + + if ( m_curr_View != view ){ + m_prev_View = m_curr_View; + m_curr_View = view; + + updateView(); + } + +} + void AbView::setShowByLetter( char c ) { @@ -402,4 +412,7 @@ void AbView::updateView() qWarning("AbView::updateView()"); + // Feed all views with new lists + updateListinViews(); + if ( m_viewStack -> visibleWidget() ){ m_viewStack -> visibleWidget() -> clearFocus(); @@ -416,8 +429,11 @@ void AbView::updateView() break; } - emit signalViewSwitched ( (int) m_curr_View ); }else m_curr_Contact = 0; + // Inform the world that the view is changed + if ( m_curr_View != m_prev_View ) + emit signalViewSwitched ( (int) m_curr_View ); + m_prev_View = m_curr_View; @@ -426,5 +442,4 @@ void AbView::updateView() case TableView: m_abTable -> setChoiceSelection( m_orderedFields ); - m_abTable -> setContacts( m_list ); if ( m_curr_Contact != 0 ) m_abTable -> selectContact ( m_curr_Contact ); @@ -432,5 +447,4 @@ void AbView::updateView() break; case CardView: - m_ablabel -> setContacts( m_list ); if ( m_curr_Contact != 0 ) m_ablabel -> selectContact( m_curr_Contact ); |