Skip to content
Snippets Groups Projects
Commit b2b1a4df authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Transfer global shortcut from old applet to new one

REVIEW: 124743
BUG: 351524
FIXED-IN: 5.4.0
parent aaf5e46e
No related merge requests found
......@@ -68,8 +68,17 @@ void AlternativesHelper::loadAlternative(const QString &plugin)
return;
}
Plasma::Applet *newApplet = Q_NULLPTR;
//TODO: map the position to containment coordinates
QMetaObject::invokeMethod(contItem, "createApplet", Q_ARG(QString, plugin), Q_ARG(QVariantList, QVariantList()), Q_ARG(QPoint, appletItem->mapToItem(contItem, QPointF(0,0)).toPoint()));
QMetaObject::invokeMethod(contItem, "createApplet", Q_RETURN_ARG(Plasma::Applet *, newApplet), Q_ARG(QString, plugin), Q_ARG(QVariantList, QVariantList()), Q_ARG(QPoint, appletItem->mapToItem(contItem, QPointF(0,0)).toPoint()));
// ensure the global shortcut is moved to the new applet
const QKeySequence &shortcut = m_applet->globalShortcut();
m_applet->setGlobalShortcut(QKeySequence()); // need to unmap the old one first
if (newApplet) {
newApplet->setGlobalShortcut(shortcut);
}
m_applet->destroy();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment