Make Konsole KPart emit a setWindowCaption() signal with the window caption as it is displayed in the standalone Konsole whenever it changes.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=754216
wilder-portage
Robert Knight 18 years ago
parent ed54c709f8
commit 1a23585d21
  1. 19
      src/Part.cpp
  2. 2
      src/Part.h

@ -172,15 +172,32 @@ Session* Part::createSession(const QString& key)
}
void Part::activeViewChanged(SessionController* controller)
{
Q_ASSERT( controller );
widget()->setFocusProxy( _viewManager->activeView() );
if ( controller == _pluggedController )
return;
if (_pluggedController) removeChildClient (_pluggedController);
// remove existing controller
if (_pluggedController)
{
removeChildClient (_pluggedController);
disconnect(_pluggedController,SIGNAL(titleChanged(ViewProperties*)),this,
SLOT(activeViewTitleChanged(ViewProperties*)));
}
// insert new controller
insertChildClient (controller);
connect(controller,SIGNAL(titleChanged(ViewProperties*)),this,
SLOT(activeViewTitleChanged(ViewProperties*)));
activeViewTitleChanged(controller);
_pluggedController = controller;
}
void Part::activeViewTitleChanged(ViewProperties* properties)
{
emit setWindowCaption(properties->title());
}
#include "Part.moc"

@ -33,6 +33,7 @@ namespace Konsole
class Session;
class SessionController;
class ViewManager;
class ViewProperties;
/**
* A factory which creates Konsole parts.
@ -77,6 +78,7 @@ private slots:
// call the run() method on the returned Session instance to begin the session
Session* createSession(const QString& key);
void activeViewChanged(SessionController* controller);
void activeViewTitleChanged(ViewProperties* properties);
void terminalExited();
void newTab();

Loading…
Cancel
Save