summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLincoln Ramsay <lincoln.ramsay@nokia.com>2010-05-24 14:48:10 +1000
committerLincoln Ramsay <lincoln.ramsay@nokia.com>2010-05-25 11:51:45 +1000
commit5e22e6ad9f7069b36605a1263dd90443b1cd475f (patch)
tree843999d61cd24419b2dbf72d54d416abecd4f1c7
parent9a9d00381d4936f3d869c05ca0febe0e5c9a636d (diff)
Fix a crash on Symbian for sensors.
Add some extra const-ness to these members. Without this fix, these members have got uninitialized values when accessed outside the library leading to a seg fault. Fixes: QTMOBILITY-273
-rwxr-xr-xsrc/sensors/make_sensor.pl4
-rw-r--r--src/sensors/qaccelerometer.cpp2
-rw-r--r--src/sensors/qaccelerometer.h2
-rw-r--r--src/sensors/qambientlightsensor.cpp2
-rw-r--r--src/sensors/qambientlightsensor.h2
-rw-r--r--src/sensors/qcompass.cpp2
-rw-r--r--src/sensors/qcompass.h2
-rw-r--r--src/sensors/qmagnetometer.cpp2
-rw-r--r--src/sensors/qmagnetometer.h2
-rw-r--r--src/sensors/qorientationsensor.cpp2
-rw-r--r--src/sensors/qorientationsensor.h2
-rw-r--r--src/sensors/qproximitysensor.cpp2
-rw-r--r--src/sensors/qproximitysensor.h2
-rw-r--r--src/sensors/qrotationsensor.cpp2
-rw-r--r--src/sensors/qrotationsensor.h2
-rw-r--r--src/sensors/qtapsensor.cpp2
-rw-r--r--src/sensors/qtapsensor.h2
17 files changed, 18 insertions, 18 deletions
diff --git a/src/sensors/make_sensor.pl b/src/sensors/make_sensor.pl
index c2b5354ecf..152f7871da 100755
--- a/src/sensors/make_sensor.pl
+++ b/src/sensors/make_sensor.pl
@@ -156,7 +156,7 @@ public:
{ setType('.$sensor.'::type); }
virtual ~'.$sensor.'() {}
'.$reading.' *reading() const { return static_cast<'.$reading.'*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE
@@ -231,7 +231,7 @@ void '.$reading.'::setMyprop(qreal myprop)
\sa QSensorFilter::filter()
*/
-const char *'.$sensor.'::type("'.$sensor.'");
+char const * const '.$sensor.'::type("'.$sensor.'");
/*!
\class '.$sensor.'
diff --git a/src/sensors/qaccelerometer.cpp b/src/sensors/qaccelerometer.cpp
index cd396fe812..d022e2858f 100644
--- a/src/sensors/qaccelerometer.cpp
+++ b/src/sensors/qaccelerometer.cpp
@@ -148,7 +148,7 @@ void QAccelerometerReading::setZ(qreal z)
\sa QSensorFilter::filter()
*/
-const char *QAccelerometer::type("QAccelerometer");
+char const * const QAccelerometer::type("QAccelerometer");
/*!
\class QAccelerometer
diff --git a/src/sensors/qaccelerometer.h b/src/sensors/qaccelerometer.h
index 34b9b8780d..e8d942e450 100644
--- a/src/sensors/qaccelerometer.h
+++ b/src/sensors/qaccelerometer.h
@@ -81,7 +81,7 @@ public:
explicit QAccelerometer(QObject *parent = 0) : QSensor(QAccelerometer::type, parent) {}
virtual ~QAccelerometer() {}
QAccelerometerReading *reading() const { return static_cast<QAccelerometerReading*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE
diff --git a/src/sensors/qambientlightsensor.cpp b/src/sensors/qambientlightsensor.cpp
index ede75d4ac3..563ec4b432 100644
--- a/src/sensors/qambientlightsensor.cpp
+++ b/src/sensors/qambientlightsensor.cpp
@@ -113,7 +113,7 @@ void QAmbientLightReading::setLightLevel(QAmbientLightReading::LightLevel lightL
\sa QSensorFilter::filter()
*/
-const char *QAmbientLightSensor::type("QAmbientLightSensor");
+char const * const QAmbientLightSensor::type("QAmbientLightSensor");
/*!
\class QAmbientLightSensor
diff --git a/src/sensors/qambientlightsensor.h b/src/sensors/qambientlightsensor.h
index f886018129..6953fd83dc 100644
--- a/src/sensors/qambientlightsensor.h
+++ b/src/sensors/qambientlightsensor.h
@@ -83,7 +83,7 @@ public:
explicit QAmbientLightSensor(QObject *parent = 0) : QSensor(QAmbientLightSensor::type, parent) {}
virtual ~QAmbientLightSensor() {}
QAmbientLightReading *reading() const { return static_cast<QAmbientLightReading*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE
diff --git a/src/sensors/qcompass.cpp b/src/sensors/qcompass.cpp
index 1c17101996..ba8dc41aa6 100644
--- a/src/sensors/qcompass.cpp
+++ b/src/sensors/qcompass.cpp
@@ -133,7 +133,7 @@ void QCompassReading::setCalibrationLevel(qreal calibrationLevel)
\sa QSensorFilter::filter()
*/
-const char *QCompass::type("QCompass");
+char const * const QCompass::type("QCompass");
/*!
\class QCompass
diff --git a/src/sensors/qcompass.h b/src/sensors/qcompass.h
index 962fb01518..86c95f5c41 100644
--- a/src/sensors/qcompass.h
+++ b/src/sensors/qcompass.h
@@ -77,7 +77,7 @@ public:
explicit QCompass(QObject *parent = 0) : QSensor(QCompass::type, parent) {}
virtual ~QCompass() {}
QCompassReading *reading() const { return static_cast<QCompassReading*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE
diff --git a/src/sensors/qmagnetometer.cpp b/src/sensors/qmagnetometer.cpp
index c1416150f4..84031bfaab 100644
--- a/src/sensors/qmagnetometer.cpp
+++ b/src/sensors/qmagnetometer.cpp
@@ -185,7 +185,7 @@ void QMagnetometerReading::setCalibrationLevel(qreal calibrationLevel)
\sa QSensorFilter::filter()
*/
-const char *QMagnetometer::type("QMagnetometer");
+char const * const QMagnetometer::type("QMagnetometer");
/*!
\class QMagnetometer
diff --git a/src/sensors/qmagnetometer.h b/src/sensors/qmagnetometer.h
index 828a12e3de..01a80e5d8d 100644
--- a/src/sensors/qmagnetometer.h
+++ b/src/sensors/qmagnetometer.h
@@ -91,7 +91,7 @@ public:
explicit QMagnetometer(QObject *parent = 0) : QSensor(QMagnetometer::type, parent) {}
virtual ~QMagnetometer() {}
QMagnetometerReading *reading() const { return static_cast<QMagnetometerReading*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE
diff --git a/src/sensors/qorientationsensor.cpp b/src/sensors/qorientationsensor.cpp
index d03843fab7..2ce920047b 100644
--- a/src/sensors/qorientationsensor.cpp
+++ b/src/sensors/qorientationsensor.cpp
@@ -122,7 +122,7 @@ void QOrientationReading::setOrientation(QOrientationReading::Orientation orient
\sa QSensorFilter::filter()
*/
-const char *QOrientationSensor::type("QOrientationSensor");
+char const * const QOrientationSensor::type("QOrientationSensor");
/*!
\class QOrientationSensor
diff --git a/src/sensors/qorientationsensor.h b/src/sensors/qorientationsensor.h
index b2a6db9cf5..8ed65ec143 100644
--- a/src/sensors/qorientationsensor.h
+++ b/src/sensors/qorientationsensor.h
@@ -84,7 +84,7 @@ public:
explicit QOrientationSensor(QObject *parent = 0) : QSensor(QOrientationSensor::type, parent) {}
virtual ~QOrientationSensor() {}
QOrientationReading *reading() const { return static_cast<QOrientationReading*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE
diff --git a/src/sensors/qproximitysensor.cpp b/src/sensors/qproximitysensor.cpp
index 2818437d36..023356f695 100644
--- a/src/sensors/qproximitysensor.cpp
+++ b/src/sensors/qproximitysensor.cpp
@@ -103,7 +103,7 @@ void QProximityReading::setClose(bool close)
\sa QSensorFilter::filter()
*/
-const char *QProximitySensor::type("QProximitySensor");
+char const * const QProximitySensor::type("QProximitySensor");
/*!
\class QProximitySensor
diff --git a/src/sensors/qproximitysensor.h b/src/sensors/qproximitysensor.h
index 6379b28897..4f84e13df4 100644
--- a/src/sensors/qproximitysensor.h
+++ b/src/sensors/qproximitysensor.h
@@ -73,7 +73,7 @@ public:
explicit QProximitySensor(QObject *parent = 0) : QSensor(QProximitySensor::type, parent) {}
virtual ~QProximitySensor() {}
QProximityReading *reading() const { return static_cast<QProximityReading*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE
diff --git a/src/sensors/qrotationsensor.cpp b/src/sensors/qrotationsensor.cpp
index 899af13197..2d7df0f854 100644
--- a/src/sensors/qrotationsensor.cpp
+++ b/src/sensors/qrotationsensor.cpp
@@ -184,7 +184,7 @@ void QRotationReading::setZ(qreal z)
\sa QSensorFilter::filter()
*/
-const char *QRotationSensor::type("QRotationSensor");
+char const * const QRotationSensor::type("QRotationSensor");
/*!
\class QRotationSensor
diff --git a/src/sensors/qrotationsensor.h b/src/sensors/qrotationsensor.h
index 887d3c9985..1d4a996538 100644
--- a/src/sensors/qrotationsensor.h
+++ b/src/sensors/qrotationsensor.h
@@ -84,7 +84,7 @@ public:
explicit QRotationSensor(QObject *parent = 0) : QSensor(QRotationSensor::type, parent) {}
virtual ~QRotationSensor() {}
QRotationReading *reading() const { return static_cast<QRotationReading*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE
diff --git a/src/sensors/qtapsensor.cpp b/src/sensors/qtapsensor.cpp
index 666af088eb..0a461d7b44 100644
--- a/src/sensors/qtapsensor.cpp
+++ b/src/sensors/qtapsensor.cpp
@@ -145,7 +145,7 @@ void QTapReading::setDoubleTap(bool doubleTap)
\sa QSensorFilter::filter()
*/
-const char *QTapSensor::type("QTapSensor");
+char const * const QTapSensor::type("QTapSensor");
/*!
\class QTapSensor
diff --git a/src/sensors/qtapsensor.h b/src/sensors/qtapsensor.h
index b27f2ddf38..2b36c29a60 100644
--- a/src/sensors/qtapsensor.h
+++ b/src/sensors/qtapsensor.h
@@ -94,7 +94,7 @@ public:
explicit QTapSensor(QObject *parent = 0) : QSensor(QTapSensor::type, parent) {}
virtual ~QTapSensor() {}
QTapReading *reading() const { return static_cast<QTapReading*>(QSensor::reading()); }
- static const char *type;
+ static char const * const type;
};
QTM_END_NAMESPACE