Warn if a composite type is not ready and continue.
authorMarco Benelli <marco.benelli@theqtcompany.com>
Thu, 23 Jul 2015 08:39:25 +0000 (10:39 +0200)
committerMarco Benelli <marco.benelli@theqtcompany.com>
Tue, 1 Sep 2015 14:49:13 +0000 (14:49 +0000)
Change-Id: Ib28f484188466831e4c64aee0e36a27dd4842b06
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
tools/qmlplugindump/main.cpp

index 96c23ae268cc6487331b5a8143bcd58e1f797396..6248d3dc642147fdcce4366a74133f262c4e569f 100644 (file)
@@ -461,6 +461,12 @@ public:
     void dumpComposite(QQmlEngine *engine, const QQmlType *compositeType, QSet<QByteArray> &defaultReachableNames)
     {
         QQmlComponent e(engine, compositeType->sourceUrl());
+        if (!e.isReady()) {
+            std::cerr << "WARNING: skipping module " << compositeType->elementName().toStdString()
+                      << std::endl << e.errorString().toStdString() << std::endl;
+            return;
+        }
+
         QObject *object = e.create();
 
         if (!object)
@@ -899,6 +905,7 @@ void printDebugMessage(QtMsgType, const QMessageLogContext &, const QString &msg
     // In case of QtFatalMsg the calling code will abort() when appropriate.
 }
 
+
 int main(int argc, char *argv[])
 {
 #if defined(Q_OS_WIN) && !defined(Q_CC_MINGW)
@@ -1039,6 +1046,7 @@ int main(int argc, char *argv[])
     if (calculateDependencies)
         getDependencies(engine, pluginImportUri, pluginImportVersion, &dependencies);
     compactDependencies(&dependencies);
+
     // load the QtQml 2.2 builtins and the dependencies
     {
         QByteArray code("import QtQml 2.2");