- remove deprecated createInstance call
- as Containment is going to remain an Applet, we can put the context menu hack in Applet instead which is nicer on the widgets anyways. also make it a bit less of a hack... svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=717489
This commit is contained in:
parent
f4efdfa1f0
commit
9fa4ea3ec3
23
applet.cpp
23
applet.cpp
@ -990,7 +990,7 @@ Applet* Applet::loadApplet(const QString& appletName, uint appletId, const QVari
|
||||
QVariantList allArgs;
|
||||
allArgs << offers.first()->storageId() << appletId << args;
|
||||
QString error;
|
||||
Applet* applet = KService::createInstance<Plasma::Applet>(offers.first(), 0, allArgs, &error);
|
||||
Applet* applet = offers.first()->createInstance<Plasma::Applet>(0, allArgs, &error);
|
||||
|
||||
if (!applet) {
|
||||
kDebug() << "Couldn't load applet \"" << appletName << "\"! reason given: " << error;
|
||||
@ -1073,6 +1073,27 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
void Applet::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
//kDebug() << "context menu event!";
|
||||
if (!scene()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Applet* containment = dynamic_cast<Plasma::Applet*>(topLevelItem());
|
||||
|
||||
if (!containment) {
|
||||
Widget::contextMenuEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
// we want to pass up the context menu event to the Containment at
|
||||
// this point
|
||||
containment->contextMenuEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
#include "applet.moc"
|
||||
|
Loading…
Reference in New Issue
Block a user