Use AbstractClient in UserActionsMenu for tab functionality
This commit is contained in:
parent
46d8b87646
commit
b6befb4ef8
1 changed files with 6 additions and 7 deletions
|
@ -502,7 +502,7 @@ void UserActionsMenu::selectPopupClientTab(QAction* action)
|
||||||
if (!(!m_client.isNull() && m_client.data()->tabGroup()) || !action->data().isValid())
|
if (!(!m_client.isNull() && m_client.data()->tabGroup()) || !action->data().isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Client *other = action->data().value<Client*>()) {
|
if (AbstractClient *other = action->data().value<AbstractClient*>()) {
|
||||||
m_client.data()->tabGroup()->setCurrent(other);
|
m_client.data()->tabGroup()->setCurrent(other);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -547,10 +547,10 @@ void UserActionsMenu::entabPopupClient(QAction* action)
|
||||||
{
|
{
|
||||||
if (m_client.isNull() || !action->data().isValid())
|
if (m_client.isNull() || !action->data().isValid())
|
||||||
return;
|
return;
|
||||||
Client *other = dynamic_cast<Client*>(action->data().value<AbstractClient*>());
|
AbstractClient *other = action->data().value<AbstractClient*>();
|
||||||
if (!Workspace::self()->clientList().contains(other)) // might have been lost betwenn pop-up and selection
|
if (!Workspace::self()->allClientList().contains(other)) // might have been lost betwenn pop-up and selection
|
||||||
return;
|
return;
|
||||||
Client *c = dynamic_cast<Client*>(m_client.data());
|
AbstractClient *c = m_client.data();
|
||||||
if (!c) {
|
if (!c) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -564,9 +564,8 @@ void UserActionsMenu::rebuildTabGroupPopup()
|
||||||
Q_ASSERT(m_addTabsMenu);
|
Q_ASSERT(m_addTabsMenu);
|
||||||
|
|
||||||
m_addTabsMenu->clear();
|
m_addTabsMenu->clear();
|
||||||
QList<Client*> handled;
|
const auto &clientList = Workspace::self()->allClientList();
|
||||||
const ClientList &clientList = Workspace::self()->clientList();
|
for (auto i = clientList.constBegin(), end = clientList.constEnd(); i != end; ++i) {
|
||||||
for (QList<Client*>::const_iterator i = clientList.constBegin(), end = clientList.constEnd(); i != end; ++i) {
|
|
||||||
if (*i == m_client.data() || (*i)->noBorder())
|
if (*i == m_client.data() || (*i)->noBorder())
|
||||||
continue;
|
continue;
|
||||||
m_addTabsMenu->addAction(shortCaption((*i)->caption()))->setData(QVariant::fromValue(*i));
|
m_addTabsMenu->addAction(shortCaption((*i)->caption()))->setData(QVariant::fromValue(*i));
|
||||||
|
|
Loading…
Reference in a new issue