[tabbox] Drop TabBoxClient::window() method

Summary: TabBoxClient::window() method is no longer used by the tabbox.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25092
This commit is contained in:
Vlad Zahorodnii 2019-10-31 15:03:39 +02:00
parent c22546868d
commit 23b53423c4
8 changed files with 10 additions and 25 deletions

View file

@ -23,10 +23,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KWin
{
MockTabBoxClient::MockTabBoxClient(QString caption, WId id)
MockTabBoxClient::MockTabBoxClient(QString caption)
: TabBoxClient()
, m_caption(caption)
, m_wId(id)
{
}

View file

@ -30,7 +30,7 @@ namespace KWin
class MockTabBoxClient : public TabBox::TabBoxClient
{
public:
explicit MockTabBoxClient(QString caption, WId id);
explicit MockTabBoxClient(QString caption);
bool isMinimized() const override {
return false;
}
@ -53,9 +53,6 @@ public:
int width() const override {
return 100;
}
WId window() const override {
return m_wId;
}
int x() const override {
return 0;
}
@ -72,7 +69,6 @@ public:
private:
QString m_caption;
WId m_wId;
};
} // namespace KWin
#endif

View file

@ -100,9 +100,9 @@ bool MockTabBoxHandler::isInFocusChain(TabBox::TabBoxClient *client) const
return false;
}
QWeakPointer< TabBox::TabBoxClient > MockTabBoxHandler::createMockWindow(const QString &caption, WId id)
QWeakPointer< TabBox::TabBoxClient > MockTabBoxHandler::createMockWindow(const QString &caption)
{
QSharedPointer< TabBox::TabBoxClient > client(new MockTabBoxClient(caption, id));
QSharedPointer< TabBox::TabBoxClient > client(new MockTabBoxClient(caption));
m_windows.append(client);
m_activeClient = client;
return QWeakPointer< TabBox::TabBoxClient >(client);

View file

@ -100,7 +100,7 @@ public:
}
// mock methods
QWeakPointer<TabBox::TabBoxClient> createMockWindow(const QString &caption, WId id);
QWeakPointer<TabBox::TabBoxClient> createMockWindow(const QString &caption);
void closeWindow(TabBox::TabBoxClient *client);
private:
QList< QSharedPointer<TabBox::TabBoxClient> > m_windows;

View file

@ -38,7 +38,7 @@ void TestTabBoxClientModel::testLongestCaptionWithNullClient()
clientModel->createClientList();
QCOMPARE(clientModel->longestCaption(), QString());
// add a window to the mock
tabboxhandler.createMockWindow(QString("test"), 1);
tabboxhandler.createMockWindow(QString("test"));
clientModel->createClientList();
QCOMPARE(clientModel->longestCaption(), QString("test"));
// delete the one client in the list
@ -59,8 +59,8 @@ void TestTabBoxClientModel::testCreateClientListNoActiveClient()
clientModel->createClientList();
QCOMPARE(clientModel->rowCount(), 0);
// create two windows, rowCount() should go to two
QWeakPointer<TabBox::TabBoxClient> client = tabboxhandler.createMockWindow(QString("test"), 1);
tabboxhandler.createMockWindow(QString("test2"), 2);
QWeakPointer<TabBox::TabBoxClient> client = tabboxhandler.createMockWindow(QString("test"));
tabboxhandler.createMockWindow(QString("test2"));
clientModel->createClientList();
QCOMPARE(clientModel->rowCount(), 2);
// let's ensure there is no active client
@ -76,8 +76,8 @@ void TestTabBoxClientModel::testCreateClientListActiveClientNotInFocusChain()
tabboxhandler.setConfig(TabBox::TabBoxConfig());
TabBox::ClientModel *clientModel = new TabBox::ClientModel(&tabboxhandler);
// create two windows, rowCount() should go to two
QWeakPointer<TabBox::TabBoxClient> client = tabboxhandler.createMockWindow(QString("test"), 1);
client = tabboxhandler.createMockWindow(QString("test2"), 2);
QWeakPointer<TabBox::TabBoxClient> client = tabboxhandler.createMockWindow(QString("test"));
client = tabboxhandler.createMockWindow(QString("test2"));
clientModel->createClientList();
QCOMPARE(clientModel->rowCount(), 2);

View file

@ -396,11 +396,6 @@ QIcon TabBoxClientImpl::icon() const
return m_client->icon();
}
WId TabBoxClientImpl::window() const
{
return m_client->windowId();
}
bool TabBoxClientImpl::isMinimized() const
{
return m_client->isMinimized();

View file

@ -93,7 +93,6 @@ public:
QString caption() const override;
QIcon icon() const override;
WId window() const override;
bool isMinimized() const override;
int x() const override;
int y() const override;

View file

@ -377,10 +377,6 @@ public:
* @return The icon of the client
*/
virtual QIcon icon() const = 0;
/**
* @return The window Id of the client
*/
virtual WId window() const = 0;
/**
* @return Minimized state of the client
*/