Commit f0652970 authored by Martin Flöser's avatar Martin Flöser

Drop boolean parameter from AbstractClient::caption

Summary:
With the latest refactoring AbstractClient::captionNormal is the same as
AbstractClient::caption(false) used to be. As there were only two usages
of the false parameter, let's remove this boolean trap and use proper
API calls.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7427
parent a7b29e09
...@@ -1766,15 +1766,12 @@ AbstractClient *AbstractClient::findClientWithSameCaption() const ...@@ -1766,15 +1766,12 @@ AbstractClient *AbstractClient::findClientWithSameCaption() const
return workspace()->findAbstractClient(fetchNameInternalPredicate); return workspace()->findAbstractClient(fetchNameInternalPredicate);
} }
QString AbstractClient::caption(bool full) const QString AbstractClient::caption() const
{ {
QString cap = captionNormal(); QString cap = captionNormal() + captionSuffix();
if (full) { if (unresponsive()) {
cap += captionSuffix(); cap += QLatin1String(" ");
if (unresponsive()) { cap += i18nc("Application is not responding, appended to window title", "(Not Responding)");
cap += QLatin1String(" ");
cap += i18nc("Application is not responding, appended to window title", "(Not Responding)");
}
} }
return cap; return cap;
} }
......
...@@ -348,7 +348,7 @@ public: ...@@ -348,7 +348,7 @@ public:
* @see captionNormal * @see captionNormal
* @see captionSuffix * @see captionSuffix
**/ **/
QString caption(bool full = true) const; QString caption() const;
/** /**
* @returns The caption as set by the AbstractClient without any suffix. * @returns The caption as set by the AbstractClient without any suffix.
* @see caption * @see caption
......
...@@ -1180,7 +1180,7 @@ void Client::killProcess(bool ask, xcb_timestamp_t timestamp) ...@@ -1180,7 +1180,7 @@ void Client::killProcess(bool ask, xcb_timestamp_t timestamp)
QString hostname = clientMachine()->isLocal() ? QStringLiteral("localhost") : QString::fromUtf8(clientMachine()->hostName()); QString hostname = clientMachine()->isLocal() ? QStringLiteral("localhost") : QString::fromUtf8(clientMachine()->hostName());
QProcess::startDetached(QStringLiteral(KWIN_KILLER_BIN), QProcess::startDetached(QStringLiteral(KWIN_KILLER_BIN),
QStringList() << QStringLiteral("--pid") << QString::number(unsigned(pid)) << QStringLiteral("--hostname") << hostname QStringList() << QStringLiteral("--pid") << QString::number(unsigned(pid)) << QStringLiteral("--hostname") << hostname
<< QStringLiteral("--windowname") << caption(false /*full*/) << QStringLiteral("--windowname") << captionNormal()
<< QStringLiteral("--applicationname") << QString::fromUtf8(resourceClass()) << QStringLiteral("--applicationname") << QString::fromUtf8(resourceClass())
<< QStringLiteral("--wid") << QString::number(window()) << QStringLiteral("--wid") << QString::number(window())
<< QStringLiteral("--timestamp") << QString::number(timestamp), << QStringLiteral("--timestamp") << QString::number(timestamp),
......
...@@ -460,7 +460,7 @@ bool Rules::match(const Client* c) const ...@@ -460,7 +460,7 @@ bool Rules::match(const Client* c) const
// QueuedConnection, because title may change before // QueuedConnection, because title may change before
// the client is ready (could segfault!) // the client is ready (could segfault!)
static_cast<Qt::ConnectionType>(Qt::QueuedConnection|Qt::UniqueConnection)); static_cast<Qt::ConnectionType>(Qt::QueuedConnection|Qt::UniqueConnection));
if (!matchTitle(c->caption(false))) if (!matchTitle(c->captionNormal()))
return false; return false;
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment