don't crash on parse errors
This commit is contained in:
parent
e9188f712a
commit
4c2e802a7d
@ -216,25 +216,25 @@ QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::title()
|
||||
if (m_rootObject) {
|
||||
return m_rootObject.data()->property("title").value<QDeclarativeListProperty<QGraphicsObject> >();
|
||||
} else {
|
||||
return QDeclarativeListProperty<QGraphicsObject>();
|
||||
return QDeclarativeListProperty<QGraphicsObject>(this, m_dummyTitleElements);
|
||||
}
|
||||
}
|
||||
|
||||
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::content() const
|
||||
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::content()
|
||||
{
|
||||
if (m_rootObject) {
|
||||
return m_rootObject.data()->property("content").value<QDeclarativeListProperty<QGraphicsObject> >();
|
||||
} else {
|
||||
return QDeclarativeListProperty<QGraphicsObject>();
|
||||
return QDeclarativeListProperty<QGraphicsObject>(this, m_dummyContentElements);
|
||||
}
|
||||
}
|
||||
|
||||
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::buttons() const
|
||||
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::buttons()
|
||||
{
|
||||
if (m_rootObject) {
|
||||
return m_rootObject.data()->property("buttons").value<QDeclarativeListProperty<QGraphicsObject> >();
|
||||
} else {
|
||||
return QDeclarativeListProperty<QGraphicsObject>();
|
||||
return QDeclarativeListProperty<QGraphicsObject>(this, m_dummyButtonsElements);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,8 +56,8 @@ public:
|
||||
|
||||
//QML properties
|
||||
QDeclarativeListProperty<QGraphicsObject> title();
|
||||
QDeclarativeListProperty<QGraphicsObject> content() const;
|
||||
QDeclarativeListProperty<QGraphicsObject> buttons() const;
|
||||
QDeclarativeListProperty<QGraphicsObject> content();
|
||||
QDeclarativeListProperty<QGraphicsObject> buttons();
|
||||
DialogStatus::Status status() const;
|
||||
|
||||
Q_INVOKABLE void open();
|
||||
@ -86,6 +86,11 @@ private:
|
||||
QGraphicsScene *m_scene;
|
||||
QWeakPointer<QObject> m_rootObject;
|
||||
static uint s_numItems;
|
||||
|
||||
//those only used in case of error, to not make plasma crash
|
||||
QList<QGraphicsObject *> m_dummyTitleElements;
|
||||
QList<QGraphicsObject *> m_dummyContentElements;
|
||||
QList<QGraphicsObject *> m_dummyButtonsElements;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user