summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2014-08-15 11:21:43 +0200
committerEike Ziller <eike.ziller@digia.com>2014-08-15 15:33:50 +0200
commitfd3e65ef5ab6eb8e4b5bdad380d1f6862799856c (patch)
tree40eb553554229b21dab05e57702a8bd94b4313f9
parent7e38cf4ed75622fb05be585f2d2d99ebd5d172ec (diff)
downloadqtsensors-fd3e65ef5ab6eb8e4b5bdad380d1f6862799856c.tar.gz
qtsensors-fd3e65ef5ab6eb8e4b5bdad380d1f6862799856c.tar.bz2
qtsensors-fd3e65ef5ab6eb8e4b5bdad380d1f6862799856c.zip
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 <alexander.blasche@digia.com>
-rw-r--r--src/sensors/qsensormanager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sensors/qsensormanager.cpp b/src/sensors/qsensormanager.cpp
index 3b86c66..d1a570e 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) {