summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.cpp
authorulf69 <ulf69>2004-08-20 22:13:00 (UTC)
committer ulf69 <ulf69>2004-08-20 22:13:00 (UTC)
commitbc33238f8038a03e04f25ea608c53e784616fee6 (patch) (side-by-side diff)
tree6b0ce40b7f05a62b26df5eca19f9fdf4cc2cffba /kaddressbook/viewmanager.cpp
parent0b6f4c58076a92ad81085db87358fab8666276d9 (diff)
downloadkdepimpi-bc33238f8038a03e04f25ea608c53e784616fee6.zip
kdepimpi-bc33238f8038a03e04f25ea608c53e784616fee6.tar.gz
kdepimpi-bc33238f8038a03e04f25ea608c53e784616fee6.tar.bz2
performanceenhancements by removing unnecessary refreshs
Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.cpp66
1 files changed, 34 insertions, 32 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index e8c5b45..bec1862 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -102,5 +102,5 @@ void ViewManager::restoreSettings()
// been modified by global settings
QString _oldgroup = mCore->config()->group();
-
+
QDictIterator<KAddressBookView> it( mViewDict );
for ( it.toFirst(); it.current(); ++it ) {
@@ -116,5 +116,5 @@ void ViewManager::saveSettings()
{
QString _oldgroup = mCore->config()->group();
-
+
QDictIterator<KAddressBookView> it( mViewDict );
for ( it.toFirst(); it.current(); ++it ) {
@@ -126,5 +126,5 @@ void ViewManager::saveSettings()
#endif
}
-
+
Filter::save( mCore->config(), "Filter", mFilterList );
KABPrefs::instance()->mCurrentFilter = mActionSelectFilter->currentItem();
@@ -167,5 +167,5 @@ KABC::Addressee::List ViewManager::selectedAddressees() const
return list;
}
-//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()
{
@@ -207,5 +207,5 @@ void ViewManager::setActiveView( const QString &name )
QString type = config->readEntry( "Type", "Table" );
-
+
kdDebug(5720) << "ViewManager::setActiveView: creating view - " << name << endl;
@@ -213,5 +213,5 @@ void ViewManager::setActiveView( const QString &name )
if ( factory )
view = factory->view( mCore->addressBook(), mViewWidgetStack );
-
+
if ( view ) {
view->setCaption( name );
@@ -226,8 +226,8 @@ void ViewManager::setActiveView( const QString &name )
connect( view, SIGNAL( executed( const QString& ) ),
SIGNAL( executed( const QString& ) ) );
-
+
connect( view, SIGNAL( deleteRequest( ) ),
SIGNAL( deleteRequest( ) ) );
-
+
connect( view, SIGNAL( modified() ), SIGNAL( modified() ) );
connect( view, SIGNAL( dropped( QDropEvent* ) ),
@@ -236,5 +236,5 @@ void ViewManager::setActiveView( const QString &name )
}
}
-
+
// If we found or created the view, raise it and refresh it
if ( view ) {
@@ -257,10 +257,11 @@ void ViewManager::setActiveView( const QString &name )
}
//US qDebug("ViewManager::setActiveView 6" );
-
+
// Update the inc search widget to show the fields in the new active
// view.
mCore->setSearchFields( mActiveView->fields() );
- mActiveView->refresh();
+//US performance optimization. setActiveFilter calls also mActiveView->refresh()
+//US mActiveView->refresh();
}
@@ -272,5 +273,5 @@ 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()
{
@@ -304,12 +305,12 @@ void ViewManager::editView()
dlg->setWidget( wdg );
-#ifndef DESKTOP_VERSION
+#ifndef DESKTOP_VERSION
//dlg.setMaximumSize( 640, 480 );
//dlg->setGeometry( 40,40, 400, 300);
dlg->showMaximized();
#endif
-
+
KConfigGroupSaver saver( mCore->config(), mActiveView->caption() );
-
+
dlg->restoreSettings( mCore->config() );
@@ -317,5 +318,5 @@ void ViewManager::editView()
dlg->saveSettings( mCore->config() );
mActiveView->readConfig( mCore->config() );
-
+
// Set the proper filter in the view. By setting the combo
// box, the activated slot will be called, which will push
@@ -332,7 +333,8 @@ void ViewManager::editView()
}
mCore->setSearchFields( mActiveView->fields() );
- mActiveView->refresh();
+//US performance optimization. setActiveFilter calls also mActiveView->refresh()
+//US mActiveView->refresh();
}
-
+
}
delete dlg;
@@ -345,5 +347,5 @@ void ViewManager::deleteView()
QString caption = i18n( "Confirm Delete" );
-
+
if (QMessageBox::information( this, caption,
text,
@@ -396,11 +398,11 @@ void ViewManager::addView()
// write the view to the config file,
KConfig *config = mCore->config();
-
+
config->deleteGroup( newName );
KConfigGroupSaver saver( config, newName );
-
+
config->writeEntry( "Type", type );
-
+
// try to set the active view
mActionSelectView->setItems( mViewNameList );
@@ -454,5 +456,5 @@ void ViewManager::createViewFactories()
#endif //KAB_EMBEDDED
-
+
}
@@ -462,5 +464,5 @@ void ViewManager::dropped( QDropEvent *e )
#ifndef KAB_EMBEDDED
-
+
QString clipText, vcards;
KURL::List urls;
@@ -497,5 +499,5 @@ void ViewManager::dropped( QDropEvent *e )
qDebug("ViewManager::dropped() has to be changed!!" );
#endif //KAB_EMBEDDED
-
+
}
@@ -592,5 +594,5 @@ int ViewManager::filterPosition( const QString &name ) const
void ViewManager::initActions()
{
-//US <ActionList name="view_loadedviews"/>
+//US <ActionList name="view_loadedviews"/>
//US <Separator/>
@@ -600,5 +602,5 @@ void ViewManager::initActions()
QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu();
#endif //KAB_EMBEDDED
-
+
mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" );
#if KDE_VERSION >= 309
@@ -608,10 +610,10 @@ void ViewManager::initActions()
SLOT( setActiveView( const QString& ) ) );
-
+
#ifdef KAB_EMBEDDED
mActionSelectView->plug(viewmenu);
viewmenu->insertSeparator();
#endif //KAB_EMBEDDED
-
+
KAction *action;
@@ -659,6 +661,6 @@ void ViewManager::initActions()
"options_edit_filters" );
- 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
mActionSelectFilter->setMenuAccelsEnabled( false );
@@ -671,5 +673,5 @@ void ViewManager::initActions()
mActionSelectFilter->plug(viewmenu);
#endif //KAB_EMBEDDED
-
+
}