summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.cpp
Unidiff
Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index bec1862..45c7b55 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -313,48 +313,53 @@ void ViewManager::editView()
313 KConfigGroupSaver saver( mCore->config(), mActiveView->caption() ); 313 KConfigGroupSaver saver( mCore->config(), mActiveView->caption() );
314 314
315 dlg->restoreSettings( mCore->config() ); 315 dlg->restoreSettings( mCore->config() );
316 316
317 if ( dlg->exec() ) { 317 if ( dlg->exec() ) {
318 dlg->saveSettings( mCore->config() ); 318 dlg->saveSettings( mCore->config() );
319 mActiveView->readConfig( mCore->config() ); 319 mActiveView->readConfig( mCore->config() );
320 320
321 // Set the proper filter in the view. By setting the combo 321 // Set the proper filter in the view. By setting the combo
322 // box, the activated slot will be called, which will push 322 // box, the activated slot will be called, which will push
323 // the filter to the view and refresh it. 323 // the filter to the view and refresh it.
324 if ( mActiveView->defaultFilterType() == KAddressBookView::None ) { 324 if ( mActiveView->defaultFilterType() == KAddressBookView::None ) {
325 mActionSelectFilter->setCurrentItem( 0 ); 325 mActionSelectFilter->setCurrentItem( 0 );
326 setActiveFilter( 0 ); 326 setActiveFilter( 0 );
327 } else if ( mActiveView->defaultFilterType() == KAddressBookView::Active ) { 327 } else if ( mActiveView->defaultFilterType() == KAddressBookView::Active ) {
328 setActiveFilter( mActionSelectFilter->currentItem() ); 328 setActiveFilter( mActionSelectFilter->currentItem() );
329 } else { 329 } else {
330 uint pos = filterPosition( mActiveView->defaultFilterName() ); 330 uint pos = filterPosition( mActiveView->defaultFilterName() );
331 mActionSelectFilter->setCurrentItem( pos ); 331 mActionSelectFilter->setCurrentItem( pos );
332 setActiveFilter( pos ); 332 setActiveFilter( pos );
333 } 333 }
334 mCore->setSearchFields( mActiveView->fields() ); 334 mCore->setSearchFields( mActiveView->fields() );
335//US performance optimization. setActiveFilter calls also mActiveView->refresh() 335//US performance optimization. setActiveFilter calls also mActiveView->refresh()
336//US mActiveView->refresh(); 336//US mActiveView->refresh();
337
338
339 //US this is a bugfix, that we get notified if we change a views configuration
340 emit modified();
341
337 } 342 }
338 343
339 } 344 }
340 delete dlg; 345 delete dlg;
341} 346}
342 347
343void ViewManager::deleteView() 348void ViewManager::deleteView()
344{ 349{
345 QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" ) 350 QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" )
346 .arg( mActiveView->caption() ); 351 .arg( mActiveView->caption() );
347 QString caption = i18n( "Confirm Delete" ); 352 QString caption = i18n( "Confirm Delete" );
348 353
349 354
350 if (QMessageBox::information( this, caption, 355 if (QMessageBox::information( this, caption,
351 text, 356 text,
352 i18n("Yes!"), i18n("No"), 0, 0 ) == 0) 357 i18n("Yes!"), i18n("No"), 0, 0 ) == 0)
353 { 358 {
354 mViewNameList.remove( mActiveView->caption() ); 359 mViewNameList.remove( mActiveView->caption() );
355 360
356 // remove the view from the config file 361 // remove the view from the config file
357 KConfig *config = mCore->config(); 362 KConfig *config = mCore->config();
358 config->deleteGroup( mActiveView->caption() ); 363 config->deleteGroup( mActiveView->caption() );
359 364
360 mViewDict.remove( mActiveView->caption() ); 365 mViewDict.remove( mActiveView->caption() );