-rw-r--r-- | kaddressbook/viewmanager.cpp | 66 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 65 |
2 files changed, 67 insertions, 64 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index e8c5b45..bec1862 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp @@ -103,3 +103,3 @@ void ViewManager::restoreSettings() QString _oldgroup = mCore->config()->group(); - + QDictIterator<KAddressBookView> it( mViewDict ); @@ -117,3 +117,3 @@ void ViewManager::saveSettings() QString _oldgroup = mCore->config()->group(); - + QDictIterator<KAddressBookView> it( mViewDict ); @@ -127,3 +127,3 @@ void ViewManager::saveSettings() } - + Filter::save( mCore->config(), "Filter", mFilterList ); @@ -168,3 +168,3 @@ KABC::Addressee::List ViewManager::selectedAddressees() const } -//US added another method with no parameter, since my moc compiler does not support default parameters. +//US added another method with no parameter, since my moc compiler does not support default parameters. void ViewManager::setSelected() @@ -208,3 +208,3 @@ void ViewManager::setActiveView( const QString &name ) QString type = config->readEntry( "Type", "Table" ); - + kdDebug(5720) << "ViewManager::setActiveView: creating view - " << name << endl; @@ -214,3 +214,3 @@ void ViewManager::setActiveView( const QString &name ) view = factory->view( mCore->addressBook(), mViewWidgetStack ); - + if ( view ) { @@ -227,6 +227,6 @@ void ViewManager::setActiveView( const QString &name ) SIGNAL( executed( const QString& ) ) ); - + connect( view, SIGNAL( deleteRequest( ) ), SIGNAL( deleteRequest( ) ) ); - + connect( view, SIGNAL( modified() ), SIGNAL( modified() ) ); @@ -237,3 +237,3 @@ void ViewManager::setActiveView( const QString &name ) } - + // If we found or created the view, raise it and refresh it @@ -258,3 +258,3 @@ void ViewManager::setActiveView( const QString &name ) //US qDebug("ViewManager::setActiveView 6" ); - + // Update the inc search widget to show the fields in the new active @@ -263,3 +263,4 @@ void ViewManager::setActiveView( const QString &name ) - mActiveView->refresh(); +//US performance optimization. setActiveFilter calls also mActiveView->refresh() +//US mActiveView->refresh(); @@ -273,3 +274,3 @@ void ViewManager::setActiveView( const QString &name ) -//US added another method with no parameter, since my moc compiler does not support default parameters. +//US added another method with no parameter, since my moc compiler does not support default parameters. void ViewManager::refreshView() @@ -305,3 +306,3 @@ void ViewManager::editView() -#ifndef DESKTOP_VERSION +#ifndef DESKTOP_VERSION //dlg.setMaximumSize( 640, 480 ); @@ -310,5 +311,5 @@ void ViewManager::editView() #endif - + KConfigGroupSaver saver( mCore->config(), mActiveView->caption() ); - + dlg->restoreSettings( mCore->config() ); @@ -318,3 +319,3 @@ void ViewManager::editView() mActiveView->readConfig( mCore->config() ); - + // Set the proper filter in the view. By setting the combo @@ -333,5 +334,6 @@ void ViewManager::editView() mCore->setSearchFields( mActiveView->fields() ); - mActiveView->refresh(); +//US performance optimization. setActiveFilter calls also mActiveView->refresh() +//US mActiveView->refresh(); } - + } @@ -346,3 +348,3 @@ void ViewManager::deleteView() - + if (QMessageBox::information( this, caption, @@ -397,3 +399,3 @@ void ViewManager::addView() KConfig *config = mCore->config(); - + config->deleteGroup( newName ); @@ -401,5 +403,5 @@ void ViewManager::addView() KConfigGroupSaver saver( config, newName ); - + config->writeEntry( "Type", type ); - + // try to set the active view @@ -455,3 +457,3 @@ void ViewManager::createViewFactories() #endif //KAB_EMBEDDED - + } @@ -463,3 +465,3 @@ void ViewManager::dropped( QDropEvent *e ) #ifndef KAB_EMBEDDED - + QString clipText, vcards; @@ -498,3 +500,3 @@ qDebug("ViewManager::dropped() has to be changed!!" ); #endif //KAB_EMBEDDED - + } @@ -593,3 +595,3 @@ void ViewManager::initActions() { -//US <ActionList name="view_loadedviews"/> +//US <ActionList name="view_loadedviews"/> //US <Separator/> @@ -601,3 +603,3 @@ void ViewManager::initActions() #endif //KAB_EMBEDDED - + mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); @@ -609,3 +611,3 @@ void ViewManager::initActions() - + #ifdef KAB_EMBEDDED @@ -614,3 +616,3 @@ void ViewManager::initActions() #endif //KAB_EMBEDDED - + KAction *action; @@ -660,4 +662,4 @@ void ViewManager::initActions() - mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); - + mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); + #if KDE_VERSION >= 309 @@ -672,3 +674,3 @@ void ViewManager::initActions() #endif //KAB_EMBEDDED - + } diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index ee2fcf8..8d2203e 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -83,3 +83,3 @@ void KAddressBookTableView::reconstructListView() mListView->setColumnWidthMode(c++, QListView::Manual); -//US +//US // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); @@ -105,3 +105,4 @@ void KAddressBookTableView::reconstructListView() - refresh(); +//US performceimprovement. Refresh is done from the outside +//US refresh(); @@ -150,14 +151,14 @@ void KAddressBookTableView::refresh(QString uid) QString currentUID, nextUID; -#ifndef KAB_EMBEDDED +#ifndef KAB_EMBEDDED ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() ); -#else //KAB_EMBEDDED +#else //KAB_EMBEDDED ContactListViewItem *currentItem = (ContactListViewItem*)( mListView->currentItem() ); -#endif //KAB_EMBEDDED - +#endif //KAB_EMBEDDED + if ( currentItem ) { -#ifndef KAB_EMBEDDED +#ifndef KAB_EMBEDDED ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); -#else //KAB_EMBEDDED +#else //KAB_EMBEDDED ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); -#endif //KAB_EMBEDDED +#endif //KAB_EMBEDDED if ( nextItem ) @@ -193,8 +194,8 @@ void KAddressBookTableView::refresh(QString uid) while ( it.current() ) { -#ifndef KAB_EMBEDDED +#ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); -#else //KAB_EMBEDDED +#else //KAB_EMBEDDED ceItem = (ContactListViewItem*)( it.current() ); -#endif //KAB_EMBEDDED - +#endif //KAB_EMBEDDED + if ( ceItem && ceItem->addressee().uid() == uid ) { @@ -220,8 +221,8 @@ QStringList KAddressBookTableView::selectedUids() { -#ifndef KAB_EMBEDDED +#ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>(item); -#else //KAB_EMBEDDED +#else //KAB_EMBEDDED ceItem = (ContactListViewItem*)(item); -#endif //KAB_EMBEDDED - +#endif //KAB_EMBEDDED + if (ceItem != 0L) @@ -235,3 +236,3 @@ QStringList KAddressBookTableView::selectedUids() } - + return uidList; @@ -252,9 +253,9 @@ void KAddressBookTableView::setSelected(QString uid, bool selected) { -#ifndef KAB_EMBEDDED +#ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>(item); -#else //KAB_EMBEDDED +#else //KAB_EMBEDDED ceItem = (ContactListViewItem*)(item); -#endif //KAB_EMBEDDED - - +#endif //KAB_EMBEDDED + + if ((ceItem != 0L) && (ceItem->addressee().uid() == uid)) @@ -284,10 +285,10 @@ void KAddressBookTableView::addresseeSelected() found = true; -#ifndef KAB_EMBEDDED +#ifndef KAB_EMBEDDED ContactListViewItem *ceItem = dynamic_cast<ContactListViewItem*>(item); -#else //KAB_EMBEDDED +#else //KAB_EMBEDDED ContactListViewItem *ceItem = (ContactListViewItem*)(item); -#endif //KAB_EMBEDDED - +#endif //KAB_EMBEDDED + if ( ceItem ) emit selected(ceItem->addressee().uid()); @@ -304,9 +305,9 @@ void KAddressBookTableView::addresseeExecuted(QListViewItem *item) { -#ifndef KAB_EMBEDDED +#ifndef KAB_EMBEDDED ContactListViewItem *ceItem = dynamic_cast<ContactListViewItem*>(item); -#else //KAB_EMBEDDED +#else //KAB_EMBEDDED ContactListViewItem *ceItem = (ContactListViewItem*)(item); -#endif //KAB_EMBEDDED +#endif //KAB_EMBEDDED @@ -325,5 +326,5 @@ void KAddressBookTableView::addresseeDeleted() { - + emit deleteRequest(); - + } |