diff --git a/konsole/konsole.cpp b/konsole/konsole.cpp index 12c13338..66743d35 100644 --- a/konsole/konsole.cpp +++ b/konsole/konsole.cpp @@ -3472,6 +3472,14 @@ void Konsole::attachSession(TESession* session) activateSession(session); } +void Konsole::setSessionTitle( QString& title, TESession* ses ) +{ + if ( !ses ) + ses = se; + ses->setTitle( title ); + slotRenameSession( ses, title ); +} + void Konsole::renameSession(TESession* ses) { QString title = ses->Title(); bool ok; diff --git a/konsole/konsole.h b/konsole/konsole.h index 771dad30..4d9385a3 100644 --- a/konsole/konsole.h +++ b/konsole/konsole.h @@ -85,6 +85,7 @@ public: void newSession(const QString &program, const QStrList &args, const QString &term, const QString &icon, const QString &title, const QString &cwd); void setSchema(const QString & path); void setEncoding(int); + void setSessionTitle(QString&, TESession* = 0); void enableFullScripting(bool b); void enableFixedSize(bool b); diff --git a/konsole/main.cpp b/konsole/main.cpp index 230483ae..7a44e875 100644 --- a/konsole/main.cpp +++ b/konsole/main.cpp @@ -530,6 +530,7 @@ extern "C" int KDE_EXPORT kdemain(int argc, char* argv[]) key = QString("Cwd%1").arg(counter); sCwd = sessionconfig->readPathEntry(key); m->newSession(sPgm, eargs, sTerm, sIcon, sTitle, sCwd); + m->setSessionTitle(sTitle); // Use title as is key = QString("Schema%1").arg(counter); m->setSchema(sessionconfig->readEntry(key)); key = QString("Encoding%1").arg(counter);