Commit c4de70b6 authored by Robert Knight's avatar Robert Knight
Browse files

Ensure that there is always at least one session running by creating a single...

Ensure that there is always at least one session running by creating a single new session when the last one is closed.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=673745
parent 790822f1
......@@ -79,7 +79,7 @@ Part::Part(QWidget* parentWidget , QObject* parent)
connect( _viewManager , SIGNAL(activeViewChanged(SessionController*)) , this ,
SLOT(activeViewChanged(SessionController*)) );
connect( _viewManager , SIGNAL(empty()) , this , SLOT(debugFinished()) );
connect( _viewManager , SIGNAL(empty()) , this , SLOT(restart()) );
_viewManager->widget()->setParent(parentWidget);
......@@ -90,14 +90,17 @@ Part::Part(QWidget* parentWidget , QObject* parent)
}
Part::~Part()
{
// disable creation of new sessions when the last one is closed
disconnect( _viewManager , SIGNAL(empty()) , this , SLOT(restart()) );
}
bool Part::openFile()
{
return false;
}
void Part::debugFinished()
void Part::restart()
{
qDebug() << __FUNCTION__;
createSession( QString() );
showShellInDir( QString() );
}
Session* Part::activeSession() const
{
......
......@@ -79,7 +79,8 @@ private slots:
Session* createSession(const QString& key);
void activeViewChanged(SessionController* controller);
void debugFinished();
// called when the last session is closed to ensure there is always at least one active view
void restart();
private:
Session* activeSession() const;
......
Supports Markdown
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