-rw-r--r-- | kaddressbook/viewmanager.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index e8c5b45..bec1862 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp | |||
@@ -252,25 +252,26 @@ void ViewManager::setActiveView( const QString &name ) | |||
252 | setActiveFilter( mActionSelectFilter->currentItem() ); | 252 | setActiveFilter( mActionSelectFilter->currentItem() ); |
253 | } else { | 253 | } else { |
254 | uint pos = filterPosition( view->defaultFilterName() ); | 254 | uint pos = filterPosition( view->defaultFilterName() ); |
255 | mActionSelectFilter->setCurrentItem( pos ); | 255 | mActionSelectFilter->setCurrentItem( pos ); |
256 | setActiveFilter( pos ); | 256 | setActiveFilter( pos ); |
257 | } | 257 | } |
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 |
261 | // view. | 261 | // view. |
262 | mCore->setSearchFields( mActiveView->fields() ); | 262 | mCore->setSearchFields( mActiveView->fields() ); |
263 | 263 | ||
264 | mActiveView->refresh(); | 264 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() |
265 | //US mActiveView->refresh(); | ||
265 | 266 | ||
266 | } | 267 | } |
267 | else | 268 | else |
268 | { | 269 | { |
269 | qDebug("ViewManager::setActiveView: unable to find view" ); | 270 | qDebug("ViewManager::setActiveView: unable to find view" ); |
270 | kdDebug(5720) << "ViewManager::setActiveView: unable to find view\n"; | 271 | kdDebug(5720) << "ViewManager::setActiveView: unable to find view\n"; |
271 | } | 272 | } |
272 | } | 273 | } |
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() |
276 | { | 277 | { |
@@ -322,25 +323,26 @@ void ViewManager::editView() | |||
322 | // the filter to the view and refresh it. | 323 | // the filter to the view and refresh it. |
323 | if ( mActiveView->defaultFilterType() == KAddressBookView::None ) { | 324 | if ( mActiveView->defaultFilterType() == KAddressBookView::None ) { |
324 | mActionSelectFilter->setCurrentItem( 0 ); | 325 | mActionSelectFilter->setCurrentItem( 0 ); |
325 | setActiveFilter( 0 ); | 326 | setActiveFilter( 0 ); |
326 | } else if ( mActiveView->defaultFilterType() == KAddressBookView::Active ) { | 327 | } else if ( mActiveView->defaultFilterType() == KAddressBookView::Active ) { |
327 | setActiveFilter( mActionSelectFilter->currentItem() ); | 328 | setActiveFilter( mActionSelectFilter->currentItem() ); |
328 | } else { | 329 | } else { |
329 | uint pos = filterPosition( mActiveView->defaultFilterName() ); | 330 | uint pos = filterPosition( mActiveView->defaultFilterName() ); |
330 | mActionSelectFilter->setCurrentItem( pos ); | 331 | mActionSelectFilter->setCurrentItem( pos ); |
331 | setActiveFilter( pos ); | 332 | setActiveFilter( pos ); |
332 | } | 333 | } |
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 | } |
338 | delete dlg; | 340 | delete dlg; |
339 | } | 341 | } |
340 | 342 | ||
341 | void ViewManager::deleteView() | 343 | void ViewManager::deleteView() |
342 | { | 344 | { |
343 | QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" ) | 345 | QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" ) |
344 | .arg( mActiveView->caption() ); | 346 | .arg( mActiveView->caption() ); |
345 | QString caption = i18n( "Confirm Delete" ); | 347 | QString caption = i18n( "Confirm Delete" ); |
346 | 348 | ||
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 | |||
@@ -94,25 +94,26 @@ void KAddressBookTableView::reconstructListView() | |||
94 | 94 | ||
95 | if (KABPrefs::instance()->mHonorSingleClick) | 95 | if (KABPrefs::instance()->mHonorSingleClick) |
96 | connect(mListView, SIGNAL(executed(QListViewItem*)), | 96 | connect(mListView, SIGNAL(executed(QListViewItem*)), |
97 | this, SLOT(addresseeExecuted(QListViewItem*))); | 97 | this, SLOT(addresseeExecuted(QListViewItem*))); |
98 | else | 98 | else |
99 | connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), | 99 | connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), |
100 | this, SLOT(addresseeExecuted(QListViewItem*))); | 100 | this, SLOT(addresseeExecuted(QListViewItem*))); |
101 | connect(mListView, SIGNAL(returnPressed(QListViewItem*)), | 101 | connect(mListView, SIGNAL(returnPressed(QListViewItem*)), |
102 | this, SLOT(addresseeExecuted(QListViewItem*))); | 102 | this, SLOT(addresseeExecuted(QListViewItem*))); |
103 | connect(mListView, SIGNAL(signalDelete()), | 103 | connect(mListView, SIGNAL(signalDelete()), |
104 | this, SLOT(addresseeDeleted())); | 104 | this, SLOT(addresseeDeleted())); |
105 | 105 | ||
106 | refresh(); | 106 | //US performceimprovement. Refresh is done from the outside |
107 | //US refresh(); | ||
107 | 108 | ||
108 | mListView->setSorting( 0, true ); | 109 | mListView->setSorting( 0, true ); |
109 | mainLayout->addWidget( mListView ); | 110 | mainLayout->addWidget( mListView ); |
110 | mainLayout->activate(); | 111 | mainLayout->activate(); |
111 | mListView->show(); | 112 | mListView->show(); |
112 | } | 113 | } |
113 | 114 | ||
114 | void KAddressBookTableView::writeConfig(KConfig *config) | 115 | void KAddressBookTableView::writeConfig(KConfig *config) |
115 | { | 116 | { |
116 | KAddressBookView::writeConfig(config); | 117 | KAddressBookView::writeConfig(config); |
117 | 118 | ||
118 | mListView->saveLayout(config, config->group()); | 119 | mListView->saveLayout(config, config->group()); |