author | ulf69 <ulf69> | 2004-08-20 22:13:00 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-20 22:13:00 (UTC) |
commit | bc33238f8038a03e04f25ea608c53e784616fee6 (patch) (unidiff) | |
tree | 6b0ce40b7f05a62b26df5eca19f9fdf4cc2cffba | |
parent | 0b6f4c58076a92ad81085db87358fab8666276d9 (diff) | |
download | kdepimpi-bc33238f8038a03e04f25ea608c53e784616fee6.zip kdepimpi-bc33238f8038a03e04f25ea608c53e784616fee6.tar.gz kdepimpi-bc33238f8038a03e04f25ea608c53e784616fee6.tar.bz2 |
performanceenhancements by removing unnecessary refreshs
-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() | |||
103 | QString _oldgroup = mCore->config()->group(); | 103 | QString _oldgroup = mCore->config()->group(); |
104 | 104 | ||
105 | QDictIterator<KAddressBookView> it( mViewDict ); | 105 | QDictIterator<KAddressBookView> it( mViewDict ); |
@@ -117,3 +117,3 @@ void ViewManager::saveSettings() | |||
117 | QString _oldgroup = mCore->config()->group(); | 117 | QString _oldgroup = mCore->config()->group(); |
118 | 118 | ||
119 | QDictIterator<KAddressBookView> it( mViewDict ); | 119 | QDictIterator<KAddressBookView> it( mViewDict ); |
@@ -127,3 +127,3 @@ void ViewManager::saveSettings() | |||
127 | } | 127 | } |
128 | 128 | ||
129 | Filter::save( mCore->config(), "Filter", mFilterList ); | 129 | Filter::save( mCore->config(), "Filter", mFilterList ); |
@@ -168,3 +168,3 @@ KABC::Addressee::List ViewManager::selectedAddressees() const | |||
168 | } | 168 | } |
169 | //US added another method with no parameter, since my moc compiler does not support default parameters. | 169 | //US added another method with no parameter, since my moc compiler does not support default parameters. |
170 | void ViewManager::setSelected() | 170 | void ViewManager::setSelected() |
@@ -208,3 +208,3 @@ void ViewManager::setActiveView( const QString &name ) | |||
208 | QString type = config->readEntry( "Type", "Table" ); | 208 | QString type = config->readEntry( "Type", "Table" ); |
209 | 209 | ||
210 | kdDebug(5720) << "ViewManager::setActiveView: creating view - " << name << endl; | 210 | kdDebug(5720) << "ViewManager::setActiveView: creating view - " << name << endl; |
@@ -214,3 +214,3 @@ void ViewManager::setActiveView( const QString &name ) | |||
214 | view = factory->view( mCore->addressBook(), mViewWidgetStack ); | 214 | view = factory->view( mCore->addressBook(), mViewWidgetStack ); |
215 | 215 | ||
216 | if ( view ) { | 216 | if ( view ) { |
@@ -227,6 +227,6 @@ void ViewManager::setActiveView( const QString &name ) | |||
227 | SIGNAL( executed( const QString& ) ) ); | 227 | SIGNAL( executed( const QString& ) ) ); |
228 | 228 | ||
229 | connect( view, SIGNAL( deleteRequest( ) ), | 229 | connect( view, SIGNAL( deleteRequest( ) ), |
230 | SIGNAL( deleteRequest( ) ) ); | 230 | SIGNAL( deleteRequest( ) ) ); |
231 | 231 | ||
232 | connect( view, SIGNAL( modified() ), SIGNAL( modified() ) ); | 232 | connect( view, SIGNAL( modified() ), SIGNAL( modified() ) ); |
@@ -237,3 +237,3 @@ void ViewManager::setActiveView( const QString &name ) | |||
237 | } | 237 | } |
238 | 238 | ||
239 | // If we found or created the view, raise it and refresh it | 239 | // If we found or created the view, raise it and refresh it |
@@ -258,3 +258,3 @@ void ViewManager::setActiveView( const QString &name ) | |||
258 | //US qDebug("ViewManager::setActiveView 6" ); | 258 | //US qDebug("ViewManager::setActiveView 6" ); |
259 | 259 | ||
260 | // Update the inc search widget to show the fields in the new active | 260 | // Update the inc search widget to show the fields in the new active |
@@ -263,3 +263,4 @@ void ViewManager::setActiveView( const QString &name ) | |||
263 | 263 | ||
264 | mActiveView->refresh(); | 264 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() |
265 | //US mActiveView->refresh(); | ||
265 | 266 | ||
@@ -273,3 +274,3 @@ void ViewManager::setActiveView( const QString &name ) | |||
273 | 274 | ||
274 | //US added another method with no parameter, since my moc compiler does not support default parameters. | 275 | //US added another method with no parameter, since my moc compiler does not support default parameters. |
275 | void ViewManager::refreshView() | 276 | void ViewManager::refreshView() |
@@ -305,3 +306,3 @@ void ViewManager::editView() | |||
305 | 306 | ||
306 | #ifndef DESKTOP_VERSION | 307 | #ifndef DESKTOP_VERSION |
307 | //dlg.setMaximumSize( 640, 480 ); | 308 | //dlg.setMaximumSize( 640, 480 ); |
@@ -310,5 +311,5 @@ void ViewManager::editView() | |||
310 | #endif | 311 | #endif |
311 | 312 | ||
312 | KConfigGroupSaver saver( mCore->config(), mActiveView->caption() ); | 313 | KConfigGroupSaver saver( mCore->config(), mActiveView->caption() ); |
313 | 314 | ||
314 | dlg->restoreSettings( mCore->config() ); | 315 | dlg->restoreSettings( mCore->config() ); |
@@ -318,3 +319,3 @@ void ViewManager::editView() | |||
318 | mActiveView->readConfig( mCore->config() ); | 319 | mActiveView->readConfig( mCore->config() ); |
319 | 320 | ||
320 | // Set the proper filter in the view. By setting the combo | 321 | // Set the proper filter in the view. By setting the combo |
@@ -333,5 +334,6 @@ void ViewManager::editView() | |||
333 | mCore->setSearchFields( mActiveView->fields() ); | 334 | mCore->setSearchFields( mActiveView->fields() ); |
334 | mActiveView->refresh(); | 335 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() |
336 | //US mActiveView->refresh(); | ||
335 | } | 337 | } |
336 | 338 | ||
337 | } | 339 | } |
@@ -346,3 +348,3 @@ void ViewManager::deleteView() | |||
346 | 348 | ||
347 | 349 | ||
348 | if (QMessageBox::information( this, caption, | 350 | if (QMessageBox::information( this, caption, |
@@ -397,3 +399,3 @@ void ViewManager::addView() | |||
397 | KConfig *config = mCore->config(); | 399 | KConfig *config = mCore->config(); |
398 | 400 | ||
399 | config->deleteGroup( newName ); | 401 | config->deleteGroup( newName ); |
@@ -401,5 +403,5 @@ void ViewManager::addView() | |||
401 | KConfigGroupSaver saver( config, newName ); | 403 | KConfigGroupSaver saver( config, newName ); |
402 | 404 | ||
403 | config->writeEntry( "Type", type ); | 405 | config->writeEntry( "Type", type ); |
404 | 406 | ||
405 | // try to set the active view | 407 | // try to set the active view |
@@ -455,3 +457,3 @@ void ViewManager::createViewFactories() | |||
455 | #endif //KAB_EMBEDDED | 457 | #endif //KAB_EMBEDDED |
456 | 458 | ||
457 | } | 459 | } |
@@ -463,3 +465,3 @@ void ViewManager::dropped( QDropEvent *e ) | |||
463 | #ifndef KAB_EMBEDDED | 465 | #ifndef KAB_EMBEDDED |
464 | 466 | ||
465 | QString clipText, vcards; | 467 | QString clipText, vcards; |
@@ -498,3 +500,3 @@ qDebug("ViewManager::dropped() has to be changed!!" ); | |||
498 | #endif //KAB_EMBEDDED | 500 | #endif //KAB_EMBEDDED |
499 | 501 | ||
500 | } | 502 | } |
@@ -593,3 +595,3 @@ void ViewManager::initActions() | |||
593 | { | 595 | { |
594 | //US <ActionList name="view_loadedviews"/> | 596 | //US <ActionList name="view_loadedviews"/> |
595 | //US <Separator/> | 597 | //US <Separator/> |
@@ -601,3 +603,3 @@ void ViewManager::initActions() | |||
601 | #endif //KAB_EMBEDDED | 603 | #endif //KAB_EMBEDDED |
602 | 604 | ||
603 | mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); | 605 | mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); |
@@ -609,3 +611,3 @@ void ViewManager::initActions() | |||
609 | 611 | ||
610 | 612 | ||
611 | #ifdef KAB_EMBEDDED | 613 | #ifdef KAB_EMBEDDED |
@@ -614,3 +616,3 @@ void ViewManager::initActions() | |||
614 | #endif //KAB_EMBEDDED | 616 | #endif //KAB_EMBEDDED |
615 | 617 | ||
616 | KAction *action; | 618 | KAction *action; |
@@ -660,4 +662,4 @@ void ViewManager::initActions() | |||
660 | 662 | ||
661 | mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); | 663 | mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); |
662 | 664 | ||
663 | #if KDE_VERSION >= 309 | 665 | #if KDE_VERSION >= 309 |
@@ -672,3 +674,3 @@ void ViewManager::initActions() | |||
672 | #endif //KAB_EMBEDDED | 674 | #endif //KAB_EMBEDDED |
673 | 675 | ||
674 | } | 676 | } |
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() | |||
83 | mListView->setColumnWidthMode(c++, QListView::Manual); | 83 | mListView->setColumnWidthMode(c++, QListView::Manual); |
84 | //US | 84 | //US |
85 | // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); | 85 | // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); |
@@ -105,3 +105,4 @@ void KAddressBookTableView::reconstructListView() | |||
105 | 105 | ||
106 | refresh(); | 106 | //US performceimprovement. Refresh is done from the outside |
107 | //US refresh(); | ||
107 | 108 | ||
@@ -150,14 +151,14 @@ void KAddressBookTableView::refresh(QString uid) | |||
150 | QString currentUID, nextUID; | 151 | QString currentUID, nextUID; |
151 | #ifndef KAB_EMBEDDED | 152 | #ifndef KAB_EMBEDDED |
152 | ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() ); | 153 | ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() ); |
153 | #else //KAB_EMBEDDED | 154 | #else //KAB_EMBEDDED |
154 | ContactListViewItem *currentItem = (ContactListViewItem*)( mListView->currentItem() ); | 155 | ContactListViewItem *currentItem = (ContactListViewItem*)( mListView->currentItem() ); |
155 | #endif //KAB_EMBEDDED | 156 | #endif //KAB_EMBEDDED |
156 | 157 | ||
157 | if ( currentItem ) { | 158 | if ( currentItem ) { |
158 | #ifndef KAB_EMBEDDED | 159 | #ifndef KAB_EMBEDDED |
159 | ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); | 160 | ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); |
160 | #else //KAB_EMBEDDED | 161 | #else //KAB_EMBEDDED |
161 | ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); | 162 | ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); |
162 | #endif //KAB_EMBEDDED | 163 | #endif //KAB_EMBEDDED |
163 | if ( nextItem ) | 164 | if ( nextItem ) |
@@ -193,8 +194,8 @@ void KAddressBookTableView::refresh(QString uid) | |||
193 | while ( it.current() ) { | 194 | while ( it.current() ) { |
194 | #ifndef KAB_EMBEDDED | 195 | #ifndef KAB_EMBEDDED |
195 | ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); | 196 | ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); |
196 | #else //KAB_EMBEDDED | 197 | #else //KAB_EMBEDDED |
197 | ceItem = (ContactListViewItem*)( it.current() ); | 198 | ceItem = (ContactListViewItem*)( it.current() ); |
198 | #endif //KAB_EMBEDDED | 199 | #endif //KAB_EMBEDDED |
199 | 200 | ||
200 | if ( ceItem && ceItem->addressee().uid() == uid ) { | 201 | if ( ceItem && ceItem->addressee().uid() == uid ) { |
@@ -220,8 +221,8 @@ QStringList KAddressBookTableView::selectedUids() | |||
220 | { | 221 | { |
221 | #ifndef KAB_EMBEDDED | 222 | #ifndef KAB_EMBEDDED |
222 | ceItem = dynamic_cast<ContactListViewItem*>(item); | 223 | ceItem = dynamic_cast<ContactListViewItem*>(item); |
223 | #else //KAB_EMBEDDED | 224 | #else //KAB_EMBEDDED |
224 | ceItem = (ContactListViewItem*)(item); | 225 | ceItem = (ContactListViewItem*)(item); |
225 | #endif //KAB_EMBEDDED | 226 | #endif //KAB_EMBEDDED |
226 | 227 | ||
227 | if (ceItem != 0L) | 228 | if (ceItem != 0L) |
@@ -235,3 +236,3 @@ QStringList KAddressBookTableView::selectedUids() | |||
235 | } | 236 | } |
236 | 237 | ||
237 | return uidList; | 238 | return uidList; |
@@ -252,9 +253,9 @@ void KAddressBookTableView::setSelected(QString uid, bool selected) | |||
252 | { | 253 | { |
253 | #ifndef KAB_EMBEDDED | 254 | #ifndef KAB_EMBEDDED |
254 | ceItem = dynamic_cast<ContactListViewItem*>(item); | 255 | ceItem = dynamic_cast<ContactListViewItem*>(item); |
255 | #else //KAB_EMBEDDED | 256 | #else //KAB_EMBEDDED |
256 | ceItem = (ContactListViewItem*)(item); | 257 | ceItem = (ContactListViewItem*)(item); |
257 | #endif //KAB_EMBEDDED | 258 | #endif //KAB_EMBEDDED |
258 | 259 | ||
259 | 260 | ||
260 | if ((ceItem != 0L) && (ceItem->addressee().uid() == uid)) | 261 | if ((ceItem != 0L) && (ceItem->addressee().uid() == uid)) |
@@ -284,10 +285,10 @@ void KAddressBookTableView::addresseeSelected() | |||
284 | found = true; | 285 | found = true; |
285 | #ifndef KAB_EMBEDDED | 286 | #ifndef KAB_EMBEDDED |
286 | ContactListViewItem *ceItem | 287 | ContactListViewItem *ceItem |
287 | = dynamic_cast<ContactListViewItem*>(item); | 288 | = dynamic_cast<ContactListViewItem*>(item); |
288 | #else //KAB_EMBEDDED | 289 | #else //KAB_EMBEDDED |
289 | ContactListViewItem *ceItem | 290 | ContactListViewItem *ceItem |
290 | = (ContactListViewItem*)(item); | 291 | = (ContactListViewItem*)(item); |
291 | #endif //KAB_EMBEDDED | 292 | #endif //KAB_EMBEDDED |
292 | 293 | ||
293 | if ( ceItem ) emit selected(ceItem->addressee().uid()); | 294 | if ( ceItem ) emit selected(ceItem->addressee().uid()); |
@@ -304,9 +305,9 @@ void KAddressBookTableView::addresseeExecuted(QListViewItem *item) | |||
304 | { | 305 | { |
305 | #ifndef KAB_EMBEDDED | 306 | #ifndef KAB_EMBEDDED |
306 | ContactListViewItem *ceItem | 307 | ContactListViewItem *ceItem |
307 | = dynamic_cast<ContactListViewItem*>(item); | 308 | = dynamic_cast<ContactListViewItem*>(item); |
308 | #else //KAB_EMBEDDED | 309 | #else //KAB_EMBEDDED |
309 | ContactListViewItem *ceItem | 310 | ContactListViewItem *ceItem |
310 | = (ContactListViewItem*)(item); | 311 | = (ContactListViewItem*)(item); |
311 | #endif //KAB_EMBEDDED | 312 | #endif //KAB_EMBEDDED |
312 | 313 | ||
@@ -325,5 +326,5 @@ void KAddressBookTableView::addresseeDeleted() | |||
325 | { | 326 | { |
326 | 327 | ||
327 | emit deleteRequest(); | 328 | emit deleteRequest(); |
328 | 329 | ||
329 | } | 330 | } |