Commit 619f44dd authored by Robert Knight's avatar Robert Knight

Fix crash when attempting to start the program in the Konsole part before the...

Fix crash when attempting to start the program in the Konsole part before the widget is shown and given focus.  Check SessionController* pointer in the KPart before using it.  When creating a controller in the ViewManager, set it as the active controller if there is no active controller at present.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=754203
parent ccaeea48
......@@ -118,7 +118,16 @@ void Part::newTab()
}
Session* Part::activeSession() const
{
return _viewManager->activeViewController()->session();
if ( _viewManager->activeViewController() )
{
Q_ASSERT( _viewManager->activeViewController()->session());
return _viewManager->activeViewController()->session();
}
else
{
return 0;
}
}
void Part::startProgram( const QString& program,
const QStringList& arguments )
......
......@@ -463,6 +463,10 @@ SessionController* ViewManager::createController(Session* session , TerminalDisp
connect( view , SIGNAL(destroyed()) , controller , SLOT(deleteLater()) );
connect( controller , SIGNAL(sendInputToAll(bool)) , this , SLOT(sendInputToAll()) );
// if this is the first controller created then set it as the active controller
if (!_pluggedController)
_pluggedController = controller;
return controller;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment