[Konsole-devel] [PATCH] dbus - method void org.kde.konsole.Session.renameSession(QString sessionName)

Marián Kyral mkyral at email.cz
Thu Nov 5 18:28:22 UTC 2009


Hi,
the attached patch adds a possibility to permanent rename session via dbus interface. It is for KDE 4.3.3.

Regards,
Marián Kyral
-------------- next part --------------
diff -Naurb konsole-4.3.3.orig/konsole/src/org.kde.konsole.Session.xml konsole-4.3.3/konsole/src/org.kde.konsole.Session.xml
--- konsole-4.3.3.orig/konsole/src/org.kde.konsole.Session.xml	2009-11-03 20:45:36.000000000 +0100
+++ konsole-4.3.3/konsole/src/org.kde.konsole.Session.xml	2009-11-04 18:45:37.000000000 +0100
@@ -61,5 +61,8 @@
             <arg type="s" direction="out"/>
             <arg name="role" type="i" direction="in"/>
         </method>
+        <method name="renameSession">
+            <arg name="sessionName" type="s" direction="in"/>
+        </method>
     </interface>
 </node>
diff -Naurb konsole-4.3.3.orig/konsole/src/Session.cpp konsole-4.3.3/konsole/src/Session.cpp
--- konsole-4.3.3.orig/konsole/src/Session.cpp	2009-11-03 20:45:36.000000000 +0100
+++ konsole-4.3.3/konsole/src/Session.cpp	2009-11-04 18:45:18.000000000 +0100
@@ -795,6 +795,13 @@
         return QString();
 }
 
+void Session::renameSession(const QString& sessionName)
+{
+    setTabTitleFormat(Session::LocalTabTitle,sessionName);
+    setTabTitleFormat(Session::RemoteTabTitle,sessionName);
+    setTitle(Session::DisplayedTitleRole,sessionName);
+}
+
 ProcessInfo* Session::getProcessInfo()
 {
     ProcessInfo* process;
diff -Naurb konsole-4.3.3.orig/konsole/src/Session.h konsole-4.3.3/konsole/src/Session.h
--- konsole-4.3.3.orig/konsole/src/Session.h	2009-11-03 20:45:36.000000000 +0100
+++ konsole-4.3.3/konsole/src/Session.h	2009-11-04 18:57:42.000000000 +0100
@@ -466,6 +466,11 @@
    */
   Q_SCRIPTABLE QString title(int role) const;
 
+  /**
+   * Rename session to @p sessionName.
+   */
+  Q_SCRIPTABLE void renameSession(const QString& sessionName);
+
 signals:
 
   /** Emitted when the terminal process starts. */


More information about the konsole-devel mailing list