From 6244008dcb43dde15dea3becbbec07d941b4759c Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 28 Jun 2011 13:52:03 +0200 Subject: [PATCH] qmldump: Improve error message for misbehaving plugin components. Change-Id: I7a7c4e5a0fc241a5cc6cb143df37cc63ea7711ea Reviewed-on: http://codereview.qt.nokia.com/867 Reviewed-by: Kai Koehne --- share/qtcreator/qml/qmldump/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qml/qmldump/main.cpp b/share/qtcreator/qml/qmldump/main.cpp index 24001b3674d..8ac0411dec3 100644 --- a/share/qtcreator/qml/qmldump/main.cpp +++ b/share/qtcreator/qml/qmldump/main.cpp @@ -62,6 +62,9 @@ QString pluginImportPath; bool verbose = false; +QString currentProperty; +QString inObjectInstantiation; + void collectReachableMetaObjects(const QMetaObject *meta, QSet *metas) { if (! meta || metas->contains(meta)) @@ -75,8 +78,6 @@ void collectReachableMetaObjects(const QMetaObject *meta, QSetsuperClass(), metas); } -QString currentProperty; - void collectReachableMetaObjects(QObject *object, QSet *metas) { if (! object) @@ -208,7 +209,10 @@ QSet collectReachableMetaObjects(const QString &importCode, QDeclarativeComponent c(engine); c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml")); + inObjectInstantiation = tyName; QObject *object = c.create(); + inObjectInstantiation.clear(); + if (object) collectReachableMetaObjects(object, &metas); else @@ -427,6 +431,8 @@ void sigSegvHandler(int) { fprintf(stderr, "Error: SEGV\n"); if (!currentProperty.isEmpty()) fprintf(stderr, "While processing the property '%s', which probably has uninitialized data.\n", currentProperty.toLatin1().constData()); + if (!inObjectInstantiation.isEmpty()) + fprintf(stderr, "While instantiating the object '%s'.\n", inObjectInstantiation.toLatin1().constData()); exit(EXIT_SEGV); } #endif