aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2011-10-31 14:40:37 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-01 17:04:09 +0100
commitedfeaf5df3737846c328042ff5670d27ef78426d (patch)
treef4119ea9f863d06bccc27837c3dc6c4f9c252ab1 /src/declarative/debugger
parent1695f0622b4673c49ccb6b127f1a7d9b24611d80 (diff)
Debugger: Add QML_DEBUGGER_VERBOSE environment variable
Print detailed information about plugin loading when QML_DEBUGGER_VERBOSE is set in the environment. Change-Id: I48b9df01948b2cd226969cfbc520801527ff5492 Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'src/declarative/debugger')
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp17
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorservice.cpp26
2 files changed, 39 insertions, 4 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp
index 5a888c7dc1..a4f5bd28f0 100644
--- a/src/declarative/debugger/qdeclarativedebugserver.cpp
+++ b/src/declarative/debugger/qdeclarativedebugserver.cpp
@@ -77,6 +77,8 @@ QT_BEGIN_NAMESPACE
const int protocolVersion = 1;
+// print detailed information about loading of plugins
+DEFINE_BOOL_CONFIG_OPTION(qmlDebugVerbose, QML_DEBUGGER_VERBOSE)
class QDeclarativeDebugServerPrivate : public QObjectPrivate
{
@@ -137,16 +139,29 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio
}
foreach (const QString &pluginPath, pluginCandidates) {
+ if (qmlDebugVerbose())
+ qDebug() << "QDeclarativeDebugServer: Trying to load plugin " << pluginPath << "...";
+
QPluginLoader loader(pluginPath);
if (!loader.load()) {
+ if (qmlDebugVerbose())
+ qDebug() << "QDeclarativeDebugServer: Error while loading: " << loader.errorString();
continue;
}
QDeclarativeDebugServerConnection *connection = 0;
if (QObject *instance = loader.instance())
connection = qobject_cast<QDeclarativeDebugServerConnection*>(instance);
- if (connection)
+ if (connection) {
+ if (qmlDebugVerbose())
+ qDebug() << "QDeclarativeDebugServer: Plugin successfully loaded.";
+
return connection;
+ }
+
+ if (qmlDebugVerbose())
+ qDebug() << "QDeclarativeDebugServer: Plugin does not implement interface QDeclarativeDebugServerConnection.";
+
loader.unload();
}
#endif
diff --git a/src/declarative/debugger/qdeclarativeinspectorservice.cpp b/src/declarative/debugger/qdeclarativeinspectorservice.cpp
index d6fdaa59e3..c3f90d2cab 100644
--- a/src/declarative/debugger/qdeclarativeinspectorservice.cpp
+++ b/src/declarative/debugger/qdeclarativeinspectorservice.cpp
@@ -48,6 +48,9 @@
#include <QtCore/QDir>
#include <QtCore/QPluginLoader>
+// print detailed information about loading of plugins
+DEFINE_BOOL_CONFIG_OPTION(qmlDebugVerbose, QML_DEBUGGER_VERBOSE)
+
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QDeclarativeInspectorService, serviceInstance)
@@ -115,6 +118,10 @@ void QDeclarativeInspectorService::updateStatus()
}
}
+ if (!m_currentInspectorPlugin) {
+ qWarning() << "QDeclarativeInspector: No plugin available for view '" << m_views.first()->metaObject()->className() << "'.";
+ return;
+ }
m_currentInspectorPlugin->activate(m_views.first());
} else {
if (m_currentInspectorPlugin) {
@@ -142,16 +149,29 @@ void QDeclarativeInspectorService::loadInspectorPlugins()
}
foreach (const QString &pluginPath, pluginCandidates) {
+ if (qmlDebugVerbose())
+ qDebug() << "QDeclarativeInspector: Trying to load plugin " << pluginPath << "...";
+
QPluginLoader loader(pluginPath);
- if (!loader.load())
+ if (!loader.load()) {
+ if (qmlDebugVerbose())
+ qDebug() << "QDeclarativeInspector: Error while loading: " << loader.errorString();
+
continue;
+ }
QDeclarativeInspectorInterface *inspector =
qobject_cast<QDeclarativeInspectorInterface*>(loader.instance());
- if (inspector)
+ if (inspector) {
+ if (qmlDebugVerbose())
+ qDebug() << "QDeclarativeInspector: Plugin successfully loaded.";
m_inspectorPlugins << inspector;
- else
+ } else {
+ if (qmlDebugVerbose())
+ qDebug() << "QDeclarativeInspector: Plugin does not implement interface QDeclarativeInspectorInterface.";
+
loader.unload();
+ }
}
}