summaryrefslogtreecommitdiffstats
path: root/src/sensors
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-12 16:31:30 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-12 16:32:04 +0200
commit15e924486a410780fefbc5a95fae8886e3190925 (patch)
treec6d784f1c528a0fe75367db415240fc4dfe5c73a /src/sensors
parentea7af7f00886f77941b81262e597c3b7f3477f48 (diff)
parent4c29e9149a583b48e563ad44b59666a9d45f9347 (diff)
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts: src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp src/sensors/qcompass.cpp Change-Id: Idfcbbfe1757a4b827663453abc27f4026cd3d752
Diffstat (limited to 'src/sensors')
-rw-r--r--src/sensors/qcompass.cpp2
-rw-r--r--src/sensors/qsensormanager.cpp28
2 files changed, 24 insertions, 6 deletions
diff --git a/src/sensors/qcompass.cpp b/src/sensors/qcompass.cpp
index 6564d362..468668ff 100644
--- a/src/sensors/qcompass.cpp
+++ b/src/sensors/qcompass.cpp
@@ -75,7 +75,7 @@ IMPLEMENT_READING(QCompassReading)
\property QCompassReading::azimuth
\brief the azimuth of the device.
- Measured in degrees from magnetic north in a clockwise direction based
+ Measured in degrees from magnetic north in a clockwise direction based on
the top of the device, as defined by QPlatformScreen::nativeOrientation.
\sa {QCompassReading Units}
*/
diff --git a/src/sensors/qsensormanager.cpp b/src/sensors/qsensormanager.cpp
index 29bd4b5f..abe5f853 100644
--- a/src/sensors/qsensormanager.cpp
+++ b/src/sensors/qsensormanager.cpp
@@ -48,12 +48,15 @@
#include "sensorlog_p.h"
#include <QTimer>
#include <QFile>
+#include <QLoggingCategory>
QT_BEGIN_NAMESPACE
typedef QHash<QByteArray,QSensorBackendFactory*> FactoryForIdentifierMap;
typedef QHash<QByteArray,FactoryForIdentifierMap> BackendIdentifiersForTypeMap;
+static QLoggingCategory sensorsCategory("qt.sensors");
+
class QSensorManagerPrivate : public QObject
{
friend class QSensorManager;
@@ -77,7 +80,6 @@ public:
loadExternalPlugins = false;
}
}
-
bool loadExternalPlugins;
PluginLoadingState pluginLoadingState;
QFactoryLoader *loader;
@@ -101,9 +103,16 @@ public:
if (config.isEmpty()) return; // QStandardPaths is broken?
config += QLatin1String("/QtProject/Sensors.conf");
#endif
- if (!QFile::exists(config)) return;
+ qCDebug(sensorsCategory) << "Loading config from" << config;
+ if (!QFile::exists(config)) {
+ qCWarning(sensorsCategory) << "There is no config file" << config;
+ return;
+ }
QFile cfgfile(config);
- if (!cfgfile.open(QFile::ReadOnly)) return;
+ if (!cfgfile.open(QFile::ReadOnly)) {
+ qCWarning(sensorsCategory) << "Can't open config file" << config;
+ return;
+ }
QTextStream stream(&cfgfile);
QString line;
@@ -169,13 +178,19 @@ Q_GLOBAL_STATIC(QSensorManagerPrivate, sensorManagerPrivate)
static void initPlugin(QObject *o)
{
- if (!o) return;
+ qCDebug(sensorsCategory) << "Init plugin" << o;
+ if (!o) {
+ qCWarning(sensorsCategory) << "Null plugin" << o;
+ return;
+ }
QSensorManagerPrivate *d = sensorManagerPrivate();
if (!d) return; // hardly likely but just in case...
- if (d->seenPlugins.contains(o))
+ if (d->seenPlugins.contains(o)) {
+ qCDebug(sensorsCategory) << "Plugin is seen" << o;
return;
+ }
QSensorChangesInterface *changes = qobject_cast<QSensorChangesInterface*>(o);
if (changes)
@@ -184,8 +199,11 @@ static void initPlugin(QObject *o)
QSensorPluginInterface *plugin = qobject_cast<QSensorPluginInterface*>(o);
if (plugin) {
+ qCDebug(sensorsCategory) << "Register sensors for " << plugin;
d->seenPlugins.insert(o);
plugin->registerSensors();
+ } else {
+ qCWarning(sensorsCategory) << "Can't cast to plugin" << o;
}
}