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 +1,17 @@ +/********************************************************************** +** 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" @@ -139,5 +155,2 @@ void AbView::load() - // Feed all views with new lists - updateListinViews(); - qWarning ("Number of contacts: %d", m_list.count()); @@ -161,16 +174,5 @@ 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 )"); @@ -184,14 +186,6 @@ void AbView::setShowByCategory( Views view, const QString& 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; @@ -203,2 +197,18 @@ 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 ) @@ -403,2 +413,5 @@ void AbView::updateView() + // Feed all views with new lists + updateListinViews(); + if ( m_viewStack -> visibleWidget() ){ @@ -417,3 +430,2 @@ void AbView::updateView() } - emit signalViewSwitched ( (int) m_curr_View ); }else @@ -421,2 +433,6 @@ void AbView::updateView() + // 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; @@ -427,3 +443,2 @@ void AbView::updateView() m_abTable -> setChoiceSelection( m_orderedFields ); - m_abTable -> setContacts( m_list ); if ( m_curr_Contact != 0 ) @@ -433,3 +448,2 @@ void AbView::updateView() case CardView: - m_ablabel -> setContacts( m_list ); if ( m_curr_Contact != 0 ) |