Enable QML_IMPORT_TRACE for setImportPathList and setPluginPathList
authorDenis Mingulov <denis@mingulov.com>
Tue, 1 May 2012 18:44:36 +0000 (21:44 +0300)
committerQt by Nokia <qt-info@nokia.com>
Tue, 8 May 2012 22:56:16 +0000 (00:56 +0200)
Currently QQmlImportDatabase methods addPluginPath and addImportPath
are providing a debug output by QML_IMPORT_TRACE environment variable.
QQmlImportDatabase::setImportPathList and QQmlImportDatabase - do not.
So the current import/plugin path list might be inconsistent with the
provided debug output.

This commit adds support for QML_IMPORT_TRACE for both 'set' methods.

Change-Id: I52bb3c7b7e7e5c1119f5b73c7574da2952f4242d
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
src/qml/qml/qqmlimport.cpp

index 2f17137..d300c38 100644 (file)
@@ -1253,6 +1253,9 @@ QStringList QQmlImportDatabase::pluginPathList() const
 */
 void QQmlImportDatabase::setPluginPathList(const QStringList &paths)
 {
+    if (qmlImportTrace())
+        qDebug().nospace() << "QQmlImportDatabase::setPluginPathList: " << paths;
+
     filePluginPath = paths;
 }
 
@@ -1315,6 +1318,9 @@ QStringList QQmlImportDatabase::importPathList() const
 */
 void QQmlImportDatabase::setImportPathList(const QStringList &paths)
 {
+    if (qmlImportTrace())
+        qDebug().nospace() << "QQmlImportDatabase::setImportPathList: " << paths;
+
     fileImportPath = paths;
 }