Fix bug where multiple Konsole KParts within one application would not work. Part::activeSession() was always returning the first session from the shared SessionManager. In the second KPart, activeSession()->isRunning() would always return true even when the session for that part was not actually running, so the session was never started.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=754194
This commit is contained in:
Robert Knight
2007-12-29 10:12:48 +00:00
parent afd172c511
commit ccaeea481a
3 changed files with 26 additions and 18 deletions

View File

@@ -458,7 +458,7 @@ SessionController* ViewManager::createController(Session* session , TerminalDisp
// create a new controller for the session, and ensure that this view manager
// is notified when the view gains the focus
SessionController* controller = new SessionController(session,view,this);
connect( controller , SIGNAL(focused(SessionController*)) , this , SIGNAL(activeViewChanged(SessionController*)) );
connect( controller , SIGNAL(focused(SessionController*)) , this , SLOT(controllerChanged(SessionController*)) );
connect( session , SIGNAL(destroyed()) , controller , SLOT(deleteLater()) );
connect( view , SIGNAL(destroyed()) , controller , SLOT(deleteLater()) );
connect( controller , SIGNAL(sendInputToAll(bool)) , this , SLOT(sendInputToAll()) );
@@ -466,6 +466,17 @@ SessionController* ViewManager::createController(Session* session , TerminalDisp
return controller;
}
void ViewManager::controllerChanged(SessionController* controller)
{
_pluggedController = controller;
emit activeViewChanged(controller);
}
SessionController* ViewManager::activeViewController() const
{
return _pluggedController;
}
void ViewManager::createView(Session* session)
{
// create the default container