summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index c738ad8..b5d9419 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -238,12 +238,15 @@ void ViewManager::setActiveView( const QString &name )
ViewFactory *factory = mViewFactoryDict.find( type );
if ( factory )
view = factory->view( mCore->addressBook(), mViewWidgetStack );
if ( view ) {
+ if ( !mViewNameList.contains( name ) ) {
+ mViewNameList.append( name );
+ }
view->setCaption( name );
mViewDict.insert( name, view );
//US my version needs an int as second parameter to addWidget
mViewWidgetStack->addWidget( view, -1 );
view->readConfig( config );
@@ -287,12 +290,16 @@ void ViewManager::setActiveView( const QString &name )
// Update the inc search widget to show the fields in the new active
// view.
mCore->setSearchFields( mActiveView->fields() );
//US performance optimization. setActiveFilter calls also mActiveView->refresh()
//US mActiveView->refresh();
+
+ mActionSelectView->setItems( mViewNameList );
+ mActionSelectView->setCurrentItem( mViewNameList.findIndex( mActiveView->caption() ) );
+
}
else
{
qDebug("ViewManager::setActiveView: unable to find view" );
}
}