From b6befb4ef88f2f741882257d957ed3339c2e2023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Sat, 5 May 2018 21:40:07 +0200 Subject: [PATCH] Use AbstractClient in UserActionsMenu for tab functionality --- useractions.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/useractions.cpp b/useractions.cpp index 71219dd319..f3ca0f90bf 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -502,7 +502,7 @@ void UserActionsMenu::selectPopupClientTab(QAction* action) if (!(!m_client.isNull() && m_client.data()->tabGroup()) || !action->data().isValid()) return; - if (Client *other = action->data().value()) { + if (AbstractClient *other = action->data().value()) { m_client.data()->tabGroup()->setCurrent(other); return; } @@ -547,10 +547,10 @@ void UserActionsMenu::entabPopupClient(QAction* action) { if (m_client.isNull() || !action->data().isValid()) return; - Client *other = dynamic_cast(action->data().value()); - if (!Workspace::self()->clientList().contains(other)) // might have been lost betwenn pop-up and selection + AbstractClient *other = action->data().value(); + if (!Workspace::self()->allClientList().contains(other)) // might have been lost betwenn pop-up and selection return; - Client *c = dynamic_cast(m_client.data()); + AbstractClient *c = m_client.data(); if (!c) { return; } @@ -564,9 +564,8 @@ void UserActionsMenu::rebuildTabGroupPopup() Q_ASSERT(m_addTabsMenu); m_addTabsMenu->clear(); - QList handled; - const ClientList &clientList = Workspace::self()->clientList(); - for (QList::const_iterator i = clientList.constBegin(), end = clientList.constEnd(); i != end; ++i) { + const auto &clientList = Workspace::self()->allClientList(); + for (auto i = clientList.constBegin(), end = clientList.constEnd(); i != end; ++i) { if (*i == m_client.data() || (*i)->noBorder()) continue; m_addTabsMenu->addAction(shortCaption((*i)->caption()))->setData(QVariant::fromValue(*i));