From fd3e65ef5ab6eb8e4b5bdad380d1f6862799856c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 15 Aug 2014 11:21:43 +0200 Subject: Do not warn when failing to load static plugins as sensor plugins Since the list of static plugins can contain all kinds of plugins, failing there is expected. Change-Id: Ia5051c75691717b2e7279a68ea06f7697cbca053 Reviewed-by: Alex Blasche --- src/sensors/qsensormanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sensors') diff --git a/src/sensors/qsensormanager.cpp b/src/sensors/qsensormanager.cpp index 3b86c669..d1a570ee 100644 --- a/src/sensors/qsensormanager.cpp +++ b/src/sensors/qsensormanager.cpp @@ -176,7 +176,7 @@ public Q_SLOTS: Q_GLOBAL_STATIC(QSensorManagerPrivate, sensorManagerPrivate) -static void initPlugin(QObject *o) +static void initPlugin(QObject *o, bool warnOnFail = true) { qCDebug(sensorsCategory) << "Init plugin" << o; if (!o) { @@ -202,7 +202,7 @@ static void initPlugin(QObject *o) qCDebug(sensorsCategory) << "Register sensors for " << plugin; d->seenPlugins.insert(o); plugin->registerSensors(); - } else { + } else if (warnOnFail) { qCWarning(sensorsCategory) << "Can't cast to plugin" << o; } } @@ -216,7 +216,7 @@ void QSensorManagerPrivate::loadPlugins() SENSORLOG() << "initializing static plugins"; // Qt-style static plugins Q_FOREACH (QObject *plugin, QPluginLoader::staticInstances()) { - initPlugin(plugin); + initPlugin(plugin, false/*do not warn on fail*/); } if (d->loadExternalPlugins) { -- cgit v1.2.3