From: Kai Koehne Date: Mon, 31 Oct 2011 13:40:37 +0000 (+0100) Subject: Debugger: Add QML_DEBUGGER_VERBOSE environment variable X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=edfeaf5df3737846c328042ff5670d27ef78426d;p=konrad%2Fqtdeclarative.git 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 --- diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp index 5a888c7..a4f5bd2 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(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 d6fdaa5..c3f90d2 100644 --- a/src/declarative/debugger/qdeclarativeinspectorservice.cpp +++ b/src/declarative/debugger/qdeclarativeinspectorservice.cpp @@ -48,6 +48,9 @@ #include #include +// 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(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(); + } } }