[Konsole-devel] [Bug 183963] renamed tab is being reset

Andrea Solis andreaks310 at gmail.com
Tue Jun 1 18:32:02 UTC 2010


https://bugs.kde.org/show_bug.cgi?id=183963


Andrea Solis <andreaks310 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andreaks310 at gmail.com




--- Comment #11 from Andrea Solis <andreaks310 gmail com>  2010-06-01 20:31:58 ---
If the tab name is changed by qdbus, this is why it almost immediately reverts
back to it's previous value:

> qdbus org.kde.konsole $KONSOLE_DBUS_SESSION org.kde.konsole.Session.setTitle 1 "foo" 

1.  The qdbus command is processed by Session::setTitle which sets the new
value in Session::_displayTitle:

        Session::_displayTitle = "foo"

2.  SessionController::snapshot is called, it obtains the current title by
calling Session::getDynamicTitle

3.  Session::getDynamicTitle formats the title by calling ProcessInfo::format
and passing either _localTabTitleFormat or _remoteTabTitleFormat.  It does
*not* use _displayTitle!

4.  ProcessInfo::format replaces the formatting characters in
_localTabTitleFormat (or _remoteTabTitleFormat).  Since _displayTitle is not
used, and _localTabTitleFormat is not changed by Session::setTitle, the
previous title is returned.

Therefore, the previous title is displayed in the tab by
SessionController::snapshot

Proposed fix:

Add a new binding to the Session class so the tab title format can be
controlled via qdbus:

Q_SCRIPTABLE void Session::setTabTitleFormat(int context, const QString&
format)

To provide optimal control, it would be nice to add a "pre-formatting" method
to the Session class, Session::formatDynamicTitle.  Introduce two new
formatting characters, one would be replaced by _nameTitle and another by
_displayTitle.    

If this is implemented, then Session::getDynamicTitle would first call
Session:formatDynamicTitle, then pass the resulting string onto the
ProcessInfo::format method.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the konsole-devel mailing list