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
This commit is contained in:
parent
a7b29e09ce
commit
f0652970f4
4 changed files with 8 additions and 11 deletions
|
@ -1766,15 +1766,12 @@ AbstractClient *AbstractClient::findClientWithSameCaption() const
|
|||
return workspace()->findAbstractClient(fetchNameInternalPredicate);
|
||||
}
|
||||
|
||||
QString AbstractClient::caption(bool full) const
|
||||
QString AbstractClient::caption() const
|
||||
{
|
||||
QString cap = captionNormal();
|
||||
if (full) {
|
||||
cap += captionSuffix();
|
||||
if (unresponsive()) {
|
||||
cap += QLatin1String(" ");
|
||||
cap += i18nc("Application is not responding, appended to window title", "(Not Responding)");
|
||||
}
|
||||
QString cap = captionNormal() + captionSuffix();
|
||||
if (unresponsive()) {
|
||||
cap += QLatin1String(" ");
|
||||
cap += i18nc("Application is not responding, appended to window title", "(Not Responding)");
|
||||
}
|
||||
return cap;
|
||||
}
|
||||
|
|
|
@ -348,7 +348,7 @@ public:
|
|||
* @see captionNormal
|
||||
* @see captionSuffix
|
||||
**/
|
||||
QString caption(bool full = true) const;
|
||||
QString caption() const;
|
||||
/**
|
||||
* @returns The caption as set by the AbstractClient without any suffix.
|
||||
* @see caption
|
||||
|
|
|
@ -1180,7 +1180,7 @@ void Client::killProcess(bool ask, xcb_timestamp_t timestamp)
|
|||
QString hostname = clientMachine()->isLocal() ? QStringLiteral("localhost") : QString::fromUtf8(clientMachine()->hostName());
|
||||
QProcess::startDetached(QStringLiteral(KWIN_KILLER_BIN),
|
||||
QStringList() << QStringLiteral("--pid") << QString::number(unsigned(pid)) << QStringLiteral("--hostname") << hostname
|
||||
<< QStringLiteral("--windowname") << caption(false /*full*/)
|
||||
<< QStringLiteral("--windowname") << captionNormal()
|
||||
<< QStringLiteral("--applicationname") << QString::fromUtf8(resourceClass())
|
||||
<< QStringLiteral("--wid") << QString::number(window())
|
||||
<< QStringLiteral("--timestamp") << QString::number(timestamp),
|
||||
|
|
|
@ -460,7 +460,7 @@ bool Rules::match(const Client* c) const
|
|||
// QueuedConnection, because title may change before
|
||||
// the client is ready (could segfault!)
|
||||
static_cast<Qt::ConnectionType>(Qt::QueuedConnection|Qt::UniqueConnection));
|
||||
if (!matchTitle(c->caption(false)))
|
||||
if (!matchTitle(c->captionNormal()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue