use the actual Applet* cor contextualActions()

This commit is contained in:
Marco Martin 2013-02-15 14:30:43 +01:00
parent 962eaa98ab
commit 7cabcaa9ac

View File

@ -213,13 +213,14 @@ void ContainmentInterface::mouseReleaseEvent(QMouseEvent *event)
desktopMenu.addAction("Menu Item 2");
//FIXME: very inefficient appletAt() implementation
AppletInterface *applet = 0;
Plasma::Applet *applet = 0;
foreach (QObject *appletObject, m_appletInterfaces) {
if (applet = qobject_cast<AppletInterface *>(appletObject)) {
if (applet->contains(applet->mapFromItem(this, event->posF()))) {
if (AppletInterface *ai = qobject_cast<AppletInterface *>(appletObject)) {
if (ai->contains(ai->mapFromItem(this, event->posF()))) {
applet = ai->applet();
break;
} else {
applet = 0;
ai = 0;
}
}
}