Commit fd116bc5 authored by Lorn Potter's avatar Lorn Potter

make this compile with qt5

parent 8517c35f
......@@ -35,4 +35,6 @@ void AccelerometerAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<AccelerometerAdaptor>("accelerometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(accelerometeradaptor, AccelerometerAdaptorPlugin)
#endif
......@@ -30,6 +30,9 @@
class AccelerometerAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -40,4 +40,6 @@ void ALSAdaptorAsciiPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<ALSAdaptorAscii>("alsadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(alsadaptor, ALSAdaptorAsciiPlugin)
#endif
......@@ -36,6 +36,9 @@
class ALSAdaptorAsciiPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -36,4 +36,6 @@ void ALSAdaptorSysfsPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<ALSAdaptorSysfs>("alsadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(alsadaptor-sysfs, ALSAdaptorSysfsPlugin)
#endif
......@@ -31,6 +31,10 @@
class ALSAdaptorSysfsPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -8,6 +8,6 @@ SOURCES += alsadaptor.cpp \
include( ../adaptor-config.pri )
!mce_disable {
mce {
DEFINES += SENSORFW_MCE_WATCHER
}
......@@ -35,4 +35,6 @@ void ALSAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<ALSAdaptor>("alsadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(alsadaptor, ALSAdaptorPlugin)
#endif
......@@ -30,6 +30,9 @@
class ALSAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -35,4 +35,6 @@ void GyroscopeAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<GyroscopeAdaptor>("gyroscopeadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(gyroscopeadaptor, GyroscopeAdaptorPlugin)
#endif
......@@ -31,6 +31,9 @@
class GyroscopeAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -35,4 +35,6 @@ void KeyboardSliderAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<KeyboardSliderAdaptor>("kbslideradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(kbslideradaptor, KeyboardSliderAdaptorPlugin)
#endif
......@@ -30,6 +30,9 @@
class KeyboardSliderAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -39,4 +39,6 @@ void MagnetometerAdaptorAsciiPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<MagnetometerAdaptorAscii>("magnetometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(magnetometeradaptor, MagnetometerAdaptorAsciiPlugin)
#endif
......@@ -34,4 +34,6 @@ void MagnetometerAdaptorPluginNCDK::Register(class Loader&)
sm.registerDeviceAdaptor<MagnetometerAdaptorNCDK>("magnetometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(magnetometeradaptor, MagnetometerAdaptorPluginNCDK)
#endif
......@@ -35,4 +35,6 @@ void MagnetometerAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<MagnetometerAdaptor>("magnetometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(magnetometeradaptor, MagnetometerAdaptorPlugin)
#endif
......@@ -30,6 +30,9 @@
class MagnetometerAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -34,4 +34,6 @@ void MRSTAccelerometerAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<MRSTAccelAdaptor>("accelerometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(accelerometeradaptor-mrst, MRSTAccelerometerAdaptorPlugin)
#endif
......@@ -29,6 +29,9 @@
class MRSTAccelerometerAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -14,7 +14,7 @@ OaktrailAccelAdaptor::OaktrailAccelAdaptor (const QString& id) :
struct stat st;
devPath = Config::configuration ()->value ("oaktrail_acc_sys_path").toString ();
if ( lstat (devPath.toAscii().constData(), &st) < 0 ) {
if ( lstat (devPath.toLatin1().constData(), &st) < 0 ) {
sensordLogW () << devPath << "no found";
return;
}
......
......@@ -10,4 +10,6 @@ void OaktrailAccelerometerAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<OaktrailAccelAdaptor>("accelerometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(oaktrailaccelerometeradaptor, OaktrailAccelerometerAdaptorPlugin)
#endif
......@@ -5,6 +5,9 @@
class OaktrailAccelerometerAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -14,7 +14,7 @@ OemtabletAccelAdaptor::OemtabletAccelAdaptor (const QString& id) :
struct stat st;
devPath = Config::configuration ()->value ("oem_tablet_acc_sys_path").toString ();
if ( lstat (devPath.toAscii().constData(), &st) < 0 ) {
if ( lstat (devPath.toLatin1().constData(), &st) < 0 ) {
sensordLogW () << devPath << "no found";
return;
}
......
......@@ -10,4 +10,6 @@ void OemtabletAccelerometerAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<OemtabletAccelAdaptor>("accelerometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(oemtabletaccelerometeradaptor, OemtabletAccelerometerAdaptorPlugin)
#endif
......@@ -5,6 +5,10 @@
class OemtabletAccelerometerAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -9,4 +9,6 @@ void OEMTabletALSAdaptorAsciiPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<OEMTabletALSAdaptorAscii>("alsadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(alsadaptor, OEMTabletALSAdaptorAsciiPlugin)
#endif
......@@ -5,7 +5,10 @@
class OEMTabletALSAdaptorAsciiPlugin : public Plugin
{
private:
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -5,6 +5,9 @@
class OEMTabletGyroscopeAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -5,6 +5,9 @@
class OemtabletMagnetometerAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -10,4 +10,6 @@ void PegatronAccelerometerAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<PegatronAccelerometerAdaptor>("accelerometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(pegatronaccelerometeradaptor, PegatronAccelerometerAdaptorPlugin)
#endif
......@@ -5,6 +5,9 @@
class PegatronAccelerometerAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -39,4 +39,6 @@ void ProximityAdaptorAsciiPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<ProximityAdaptorAscii>("proximityadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(proximityadaptor, ProximityAdaptorAsciiPlugin)
#endif
......@@ -35,6 +35,9 @@
class ProximityAdaptorAsciiPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -36,4 +36,6 @@ void ProximityAdaptorEvdevPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<ProximityAdaptorEvdev>("proximityadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(proximityadaptor-evdev, ProximityAdaptorEvdevPlugin)
#endif
......@@ -31,6 +31,9 @@
class ProximityAdaptorEvdevPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -8,6 +8,6 @@ SOURCES += proximityadaptor.cpp \
include( ../adaptor-config.pri )
!mce_disable {
mce {
DEFINES += SENSORFW_MCE_WATCHER
}
......@@ -36,4 +36,6 @@ void ProximityAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<ProximityAdaptor>("proximityadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(proximityadaptor, ProximityAdaptorPlugin)
#endif
......@@ -31,6 +31,9 @@
class ProximityAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -10,4 +10,6 @@ void SteAccelerometerAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<SteAccelAdaptor>("accelerometeradaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(steaccelerometeradaptor,SteAccelerometerAdaptorPlugin)
#endif
......@@ -5,6 +5,9 @@
class SteAccelerometerAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -35,4 +35,6 @@ void TapAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<TapAdaptor>("tapadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(tapadaptor, TapAdaptorPlugin)
#endif
......@@ -30,6 +30,9 @@
class TapAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -35,4 +35,6 @@ void TouchAdaptorPlugin::Register(class Loader&)
sm.registerDeviceAdaptor<TouchAdaptor>("touchadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(touchadaptor, TouchAdaptorPlugin)
#endif
......@@ -30,6 +30,9 @@
class TouchAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -40,4 +40,6 @@ QStringList AccelerometerChainPlugin::Dependencies() {
return QString("coordinatealignfilter:accelerometeradaptor").split(":", QString::SkipEmptyParts);
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(accelerometerchain, AccelerometerChainPlugin)
#endif
......@@ -30,6 +30,10 @@
class AccelerometerChainPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
QStringList Dependencies();
......
......@@ -40,4 +40,6 @@ QStringList OrientationChainPlugin::Dependencies() {
return QString("orientationinterpreter:accelerometerchain").split(":", QString::SkipEmptyParts);
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(orientationchain, OrientationChainPlugin)
#endif
......@@ -30,6 +30,9 @@
class OrientationChainPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
QStringList Dependencies();
......
......@@ -10,7 +10,7 @@ CONFIG += debug
CONFIG += thread
# Maemo specific options
CONFIG += contextprovider
#CONFIG += contextprovider
# DEPRECATED: CompassChain is now provided by separate package
# sensorfw-plugins-compasslogic
......
......@@ -68,7 +68,7 @@ HEADERS += sensormanager.h \
config.h \
nodebase.h
!mce_disable {
mce {
SOURCES += mcewatcher.cpp
HEADERS += mcewatcher.h
DEFINES += SENSORFW_MCE_WATCHER
......
......@@ -100,7 +100,7 @@ int InputDevAdaptor::getInputDevices(const QString& typeName)
}
else
{
QByteArray byteArray = readFromFile(usedDevicePollFilePath_.toAscii());
QByteArray byteArray = readFromFile(usedDevicePollFilePath_.toLatin1());
cachedInterval_ = byteArray.size() > 0 ? byteArray.toInt() : 0;
}
......
......@@ -108,7 +108,7 @@ bool Loader::loadPlugin(const QString& name, QString* errorString)
{
QString error;
bool loaded = false;
QStringList newPluginNames;
QStringList newPluginNames;
QList<PluginBase*> newPlugins;
if (loadedPluginNames_.contains(name)) {
......
......@@ -76,7 +76,7 @@ private:
*/
QString resolveRealPluginName(const QString& pluginName) const;
QStringList loadedPluginNames_; /**< list of loaded plugins */
QStringList loadedPluginNames_; /**< list of loaded plugins */
};
#endif
......@@ -113,7 +113,7 @@ void SensordLogger::init(int target, const QString& logFilePath, const QString&
if (initialized)
return;
logTarget = target;
appName = name.toAscii();
appName = name.toLatin1();
if (target & STDERR_FILENO){
fcntl(STDERR_FILENO, F_SETFL, O_WRONLY);
}
......
......@@ -65,6 +65,6 @@ void ParameterParser::applyPropertyMap(QObject* object, const QMap<QString, QStr
for(QMap<QString, QString>::const_iterator it = propertyMap.constBegin(); it != propertyMap.constEnd(); ++it)
{
object->setProperty(it.key().toAscii().data(), QVariant(it.value()));
object->setProperty(it.key().toLatin1().data(), QVariant(it.value()));
}
}
......@@ -222,7 +222,7 @@ bool SysfsAdaptor::openFds()
int fd;
for (int i = 0; i < paths_.size(); i++) {
if ((fd = open(paths_.at(i).toAscii().constData(), O_RDONLY)) == -1) {
if ((fd = open(paths_.at(i).toLatin1().constData(), O_RDONLY)) == -1) {
sensordLogW() << "open(): " << strerror(errno);
return false;
}
......
......@@ -39,4 +39,6 @@ void SampleAdaptorPlugin::Register(class Loader&)
}
// Plugin must be exported for it to loaded properly
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(sampleadaptor, SampleAdaptorPlugin)
#endif
......@@ -30,6 +30,9 @@
class SampleAdaptorPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -44,4 +44,6 @@ QStringList SampleChainPlugin::Dependencies() {
return QString("sampleadaptor:samplefilter").split(":", QString::SkipEmptyParts);
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(samplechain, SampleChainPlugin)
#endif
......@@ -30,6 +30,9 @@
class SampleChainPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
QStringList Dependencies();
......
......@@ -35,4 +35,6 @@ void SampleFilterPlugin::Register(class Loader&)
sm.registerFilter<SampleFilter>("samplefilter");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(samplefilter, SampleFilterPlugin)
#endif
......@@ -30,6 +30,9 @@
class SampleFilterPlugin : public Plugin
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0" FILE "plugin.json")
#endif
private:
void Register(class Loader& l);
};
......
......@@ -43,4 +43,6 @@ QStringList SamplePlugin::Dependencies() {