revert last commit

create compactRepresentation in the compactrepresentation *component*
creation context

this way root is accessible by id
This commit is contained in:
Marco Martin 2013-08-22 15:04:56 +02:00
parent dbc02cd44b
commit d58f1d0a17
2 changed files with 1 additions and 14 deletions

View File

@ -135,7 +135,6 @@ void AppletInterface::init()
m_qmlObject->engine()->rootContext()->setContextProperty("plasmoid", this);
m_qmlObject->completeInitialization();
emit rootItemChanged();
qDebug() << "Graphic object created:" << applet() << applet()->property("graphicObject");
@ -209,14 +208,6 @@ QObject* AppletInterface::configuration() const
return m_configuration;
}
QObject* AppletInterface::rootItem() const
{
if (!m_qmlObject) {
return 0;
}
return m_qmlObject->rootObject();
}
QString AppletInterface::icon() const
{
return applet()->icon();
@ -666,7 +657,7 @@ void AppletInterface::compactRepresentationCheck()
QQmlComponent *compactComponent = m_qmlObject->rootObject()->property("compactRepresentation").value<QQmlComponent *>();
if (compactComponent) {
compactRepresentation = compactComponent->create(m_qmlObject->engine()->rootContext());
compactRepresentation = compactComponent->create(compactComponent->creationContext());
} else {
compactRepresentation = m_qmlObject->createObjectFromSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("defaultcompactrepresentation")));
}

View File

@ -53,7 +53,6 @@ class AppletInterface : public QQuickItem
/**
* The QML root object defined in the applet main.qml
*/
Q_PROPERTY(QObject *rootItem READ rootItem NOTIFY rootItemChanged)
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
//TODO: writable icon
Q_PROPERTY(QString icon READ icon CONSTANT)
@ -120,8 +119,6 @@ public:
//PROPERTY ACCESSORS-------------------------------------------------------------------
QObject *rootItem() const;
QString icon() const;
QString title() const;
@ -182,7 +179,6 @@ Q_SIGNALS:
void backgroundHintsChanged();
void busyChanged();
void expandedChanged();
void rootItemChanged();
void minimumWidthChanged();
void minimumHeightChanged();