use "_plasma_graphicObject" in applet*

to avoid possible collisions, use the private looking name "_plasma_graphicObject" for the dynamic property of Applet that represents the AppletInterface* pointer
This commit is contained in:
Marco Martin 2014-02-05 12:59:33 +01:00
parent 3325f24992
commit 74515ee2f5
6 changed files with 15 additions and 15 deletions

View File

@ -92,7 +92,7 @@ void ConfigViewPrivate::init()
delete object;
}
q->engine()->rootContext()->setContextProperty("plasmoid", applet->property("graphicObject").value<QObject*>());
q->engine()->rootContext()->setContextProperty("plasmoid", applet->property("_plasma_graphicObject").value<QObject*>());
q->engine()->rootContext()->setContextProperty("configDialog", q);
component->completeCreate();
delete component;

View File

@ -67,7 +67,7 @@ void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont)
if (containment) {
QObject::disconnect(containment.data(), 0, q, 0);
QObject *oldGraphicObject = containment.data()->property("graphicObject").value<QObject *>();
QObject *oldGraphicObject = containment.data()->property("_plasma_graphicObject").value<QObject *>();
if (oldGraphicObject) {
qDebug() << "Old graphics Object:" << oldGraphicObject << "Old containment" << containment.data();
//make sure the graphic object won't die with us
@ -100,7 +100,7 @@ void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont)
return;
}
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(containment.data()->property("graphicObject").value<QObject *>());
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(containment.data()->property("_plasma_graphicObject").value<QObject *>());
if (graphicObject) {

View File

@ -104,7 +104,7 @@ void AppletInterface::init()
AppletLoader::init();
qDebug() << "Graphic object created:" << applet() << applet()->property("graphicObject");
qDebug() << "Graphic object created:" << applet() << this;
geometryChanged(QRectF(), QRectF(x(), y(), width(), height()));
emit busyChanged();

View File

@ -74,7 +74,7 @@ AppletLoader::AppletLoader(Plasma::Applet *applet, QQuickItem *parent)
m_qmlObject->setInitializationDelayed(true);
// set the graphicObject dynamic property on applet
m_applet->setProperty("graphicObject", QVariant::fromValue(this));
m_applet->setProperty("_plasma_graphicObject", QVariant::fromValue(this));
setProperty("_plasma_applet", QVariant::fromValue(applet));
}

View File

@ -222,7 +222,7 @@ Plasma::Applet *ContainmentInterface::addApplet(const QString &plugin, const QVa
if (applet) {
QObject *appletGraphicObject = applet->property("graphicObject").value<QObject *>();
QObject *appletGraphicObject = applet->property("_plasma_graphicObject").value<QObject *>();
blockSignals(false);
@ -239,7 +239,7 @@ void ContainmentInterface::setAppletArgs(Plasma::Applet *applet, const QString &
return;
}
AppletInterface *appletInterface = applet->property("graphicObject").value<AppletInterface *>();
AppletInterface *appletInterface = applet->property("_plasma_graphicObject").value<AppletInterface *>();
if (appletInterface) {
emit appletInterface->externalData(mimetype, data);
}
@ -509,8 +509,8 @@ void ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
return;
}
QObject *appletGraphicObject = applet->property("graphicObject").value<QObject *>();
QObject *contGraphicObject = containment()->property("graphicObject").value<QObject *>();
QObject *appletGraphicObject = applet->property("_plasma_graphicObject").value<QObject *>();
QObject *contGraphicObject = containment()->property("_plasma_graphicObject").value<QObject *>();
qDebug() << "Applet added on containment:" << containment()->title() << contGraphicObject
<< "Applet: " << applet << applet->title() << appletGraphicObject;
@ -538,7 +538,7 @@ void ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
void ContainmentInterface::appletRemovedForward(Plasma::Applet *applet)
{
QObject *appletGraphicObject = applet->property("graphicObject").value<QObject *>();
QObject *appletGraphicObject = applet->property("_plasma_graphicObject").value<QObject *>();
m_appletInterfaces.removeAll(appletGraphicObject);
emit appletRemoved(appletGraphicObject);
emit appletsChanged();

View File

@ -182,7 +182,7 @@ void Panel::setOffset(int pixels)
return;
}
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("graphicObject").value<QObject *>());
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("_plasma_graphicObject").value<QObject *>());
if (!graphicObject) {
return;
@ -222,7 +222,7 @@ int Panel::length() const
if (!c) {
return 0;
}
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("graphicObject").value<QObject *>());
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("_plasma_graphicObject").value<QObject *>());
if (!graphicObject) {
return 0;
@ -242,7 +242,7 @@ void Panel::setLength(int pixels)
return;
}
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("graphicObject").value<QObject *>());
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("_plasma_graphicObject").value<QObject *>());
if (!graphicObject) {
return;
@ -279,7 +279,7 @@ int Panel::height() const
return 0;
}
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("graphicObject").value<QObject *>());
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("_plasma_graphicObject").value<QObject *>());
if (!graphicObject) {
return 0;
@ -296,7 +296,7 @@ void Panel::setHeight(int height)
return;
}
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("graphicObject").value<QObject *>());
QQuickItem *graphicObject = qobject_cast<QQuickItem *>(c->property("_plasma_graphicObject").value<QObject *>());
if (!graphicObject) {
return;