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

Make AbstractClient::caption no longer a virtual method

Summary:
The implementation can now be shared, it doesn't differ anymore between
X11 (Client) and Wayland (ShellClient). So instead of code duplication a
shared implementation in AbstractClient.

Test Plan: X11 and ShellClient tests still pass

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7426
parent 6685288d
......@@ -1766,4 +1766,17 @@ AbstractClient *AbstractClient::findClientWithSameCaption() const
return workspace()->findAbstractClient(fetchNameInternalPredicate);
}
QString AbstractClient::caption(bool full) const
{
QString cap = captionNormal();
if (full) {
cap += 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
**/
virtual QString caption(bool full = true) const = 0;
QString caption(bool full = true) const;
/**
* @returns The caption as set by the AbstractClient without any suffix.
* @see caption
......
......@@ -1513,22 +1513,6 @@ void Client::fetchIconicName()
}
}
/**
* \reimp
*/
QString Client::caption(bool full) const
{
QString cap = cap_normal;
if (full) {
cap += cap_suffix;
if (unresponsive()) {
cap += QLatin1String(" ");
cap += i18nc("Application is not responding, appended to window title", "(Not Responding)");
}
}
return cap;
}
bool Client::tabTo(Client *other, bool behind, bool activate)
{
Q_ASSERT(other && other != this);
......
......@@ -219,7 +219,6 @@ public:
void setBlockingCompositing(bool block);
inline bool isBlockingCompositing() { return blocks_compositing; }
QString caption(bool full = true) const override;
QString captionNormal() const override {
return cap_normal;
}
......
......@@ -566,15 +566,6 @@ void ShellClient::blockActivityUpdates(bool b)
Q_UNUSED(b)
}
QString ShellClient::caption(bool full) const
{
QString caption = m_caption;
if (full) {
caption += m_captionSuffix;
}
return caption;
}
void ShellClient::updateCaption()
{
const QString oldSuffix = m_captionSuffix;
......
......@@ -63,7 +63,6 @@ public:
}
void blockActivityUpdates(bool b = true) override;
QString caption(bool full = true) const override;
QString captionNormal() const override {
return m_caption;
}
......
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