summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <kurt.hindenburg@gmail.com>2016-11-09 00:04:56 (GMT)
committerKurt Hindenburg <kurt.hindenburg@gmail.com>2016-11-09 00:04:56 (GMT)
commita5ca90345378262825b2450ff89db7addcf89309 (patch)
treee92f20ac88a306b90f85c7757b43418add948941
parentf2358180683f96b1c47e1a441f45c88460fc23b5 (diff)
Correct handling %u when changing tab title via Rename Tab dialog
Recent code changed how %u is handled (only when %u is required, poll /proc filesystem). This correct an issue when %u is added/removed from the Rename Tab dialog.
-rw-r--r--src/ProcessInfo.h3
-rw-r--r--src/Session.cpp7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/ProcessInfo.h b/src/ProcessInfo.h
index b28a364..4c04758 100644
--- a/src/ProcessInfo.h
+++ b/src/ProcessInfo.h
@@ -189,6 +189,8 @@ public:
// space-constrained UI elements (eg. tabs)
QString formatShortDir(const QString& dirPath) const;
+ void setUserNameRequired(bool need);
+
protected:
/**
* Constructs a new process instance. You should not call the constructor
@@ -259,7 +261,6 @@ protected:
*/
void clearArguments();
- void setUserNameRequired(bool need);
bool userNameRequired() const;
private:
diff --git a/src/Session.cpp b/src/Session.cpp
index 302bddc..4ecec95 100644
--- a/src/Session.cpp
+++ b/src/Session.cpp
@@ -574,10 +574,13 @@ QString Session::userTitle() const
}
void Session::setTabTitleFormat(TabTitleContext context , const QString& format)
{
- if (context == LocalTabTitle)
+ if (context == LocalTabTitle) {
_localTabTitleFormat = format;
- else if (context == RemoteTabTitle)
+ ProcessInfo* process = getProcessInfo();
+ process->setUserNameRequired(format.contains(QLatin1String("%u")));
+ } else if (context == RemoteTabTitle) {
_remoteTabTitleFormat = format;
+ }
}
QString Session::tabTitleFormat(TabTitleContext context) const
{