Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/viewmanager.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 4be860e..04759a7 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp | |||
@@ -199,16 +199,21 @@ void ViewManager::setListSelected(QStringList list) | |||
199 | 199 | ||
200 | } | 200 | } |
201 | void ViewManager::unloadViews() | 201 | void ViewManager::unloadViews() |
202 | { | 202 | { |
203 | mViewDict.clear(); | 203 | mViewDict.clear(); |
204 | mActiveView = 0; | 204 | mActiveView = 0; |
205 | } | 205 | } |
206 | 206 | ||
207 | void ViewManager::selectView( const QString &name ) | ||
208 | { | ||
209 | setActiveView( name ); | ||
210 | mCore->saveSettings(); | ||
211 | } | ||
207 | void ViewManager::setActiveView( const QString &name ) | 212 | void ViewManager::setActiveView( const QString &name ) |
208 | { | 213 | { |
209 | KAddressBookView *view = 0; | 214 | KAddressBookView *view = 0; |
210 | 215 | ||
211 | // Check that this isn't the same as the current active view | 216 | // Check that this isn't the same as the current active view |
212 | if ( mActiveView && ( mActiveView->caption() == name ) ) | 217 | if ( mActiveView && ( mActiveView->caption() == name ) ) |
213 | return; | 218 | return; |
214 | 219 | ||
@@ -278,17 +283,16 @@ void ViewManager::setActiveView( const QString &name ) | |||
278 | //US qDebug("ViewManager::setActiveView 6" ); | 283 | //US qDebug("ViewManager::setActiveView 6" ); |
279 | 284 | ||
280 | // Update the inc search widget to show the fields in the new active | 285 | // Update the inc search widget to show the fields in the new active |
281 | // view. | 286 | // view. |
282 | mCore->setSearchFields( mActiveView->fields() ); | 287 | mCore->setSearchFields( mActiveView->fields() ); |
283 | 288 | ||
284 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() | 289 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() |
285 | //US mActiveView->refresh(); | 290 | //US mActiveView->refresh(); |
286 | mCore->saveSettings(); | ||
287 | } | 291 | } |
288 | else | 292 | else |
289 | { | 293 | { |
290 | qDebug("ViewManager::setActiveView: unable to find view" ); | 294 | qDebug("ViewManager::setActiveView: unable to find view" ); |
291 | } | 295 | } |
292 | } | 296 | } |
293 | 297 | ||
294 | //US added another method with no parameter, since my moc compiler does not support default parameters. | 298 | //US added another method with no parameter, since my moc compiler does not support default parameters. |
@@ -484,17 +488,16 @@ void ViewManager::createViewFactories() | |||
484 | // qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1()); | 488 | // qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1()); |
485 | 489 | ||
486 | #endif //KAB_EMBEDDED | 490 | #endif //KAB_EMBEDDED |
487 | 491 | ||
488 | } | 492 | } |
489 | 493 | ||
490 | void ViewManager::dropped( QDropEvent *e ) | 494 | void ViewManager::dropped( QDropEvent *e ) |
491 | { | 495 | { |
492 | kdDebug(5720) << "ViewManager::dropped: got a drop event" << endl; | ||
493 | 496 | ||
494 | #ifndef KAB_EMBEDDED | 497 | #ifndef KAB_EMBEDDED |
495 | 498 | ||
496 | QString clipText, vcards; | 499 | QString clipText, vcards; |
497 | KURL::List urls; | 500 | KURL::List urls; |
498 | 501 | ||
499 | if ( KURLDrag::decode( e, urls) ) { | 502 | if ( KURLDrag::decode( e, urls) ) { |
500 | KURL::List::Iterator it = urls.begin(); | 503 | KURL::List::Iterator it = urls.begin(); |
@@ -650,17 +653,17 @@ void ViewManager::initActions() | |||
650 | QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); | 653 | QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); |
651 | #endif //KAB_EMBEDDED | 654 | #endif //KAB_EMBEDDED |
652 | 655 | ||
653 | mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); | 656 | mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); |
654 | #if KDE_VERSION >= 309 | 657 | #if KDE_VERSION >= 309 |
655 | mActionSelectView->setMenuAccelsEnabled( false ); | 658 | mActionSelectView->setMenuAccelsEnabled( false ); |
656 | #endif | 659 | #endif |
657 | connect( mActionSelectView, SIGNAL( activated( const QString& ) ), | 660 | connect( mActionSelectView, SIGNAL( activated( const QString& ) ), |
658 | SLOT( setActiveView( const QString& ) ) ); | 661 | SLOT( selectView( const QString& ) ) ); |
659 | 662 | ||
660 | 663 | ||
661 | #ifdef KAB_EMBEDDED | 664 | #ifdef KAB_EMBEDDED |
662 | mActionSelectView->plug(viewmenu); | 665 | mActionSelectView->plug(viewmenu); |
663 | viewmenu->insertSeparator(); | 666 | viewmenu->insertSeparator(); |
664 | #endif //KAB_EMBEDDED | 667 | #endif //KAB_EMBEDDED |
665 | 668 | ||
666 | KAction *action; | 669 | KAction *action; |