summaryrefslogtreecommitdiffstats
path: root/tools/qml/deviceorientation_symbian.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-03 05:39:57 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-03 05:39:57 (GMT)
commit68c0ff0c7f1e65fb55b08a1fb9baab8176eb726c (patch)
treee3ae65fb615a4b06d774415fd2d742170104d9ce /tools/qml/deviceorientation_symbian.cpp
parentb7702b2dcbc36f81759dea0ad74fb19e97b2358f (diff)
parente62f266a7642e675e9d235a1f54a6b5746500d48 (diff)
downloadQt-68c0ff0c7f1e65fb55b08a1fb9baab8176eb726c.zip
Qt-68c0ff0c7f1e65fb55b08a1fb9baab8176eb726c.tar.gz
Qt-68c0ff0c7f1e65fb55b08a1fb9baab8176eb726c.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tools/qml/deviceorientation_symbian.cpp')
-rw-r--r--tools/qml/deviceorientation_symbian.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/qml/deviceorientation_symbian.cpp b/tools/qml/deviceorientation_symbian.cpp
index c305f94..307c417 100644
--- a/tools/qml/deviceorientation_symbian.cpp
+++ b/tools/qml/deviceorientation_symbian.cpp
@@ -110,22 +110,27 @@ private:
void DataReceived(CSensrvChannel &channel, TInt count, TInt dataLost)
{
+ Q_UNUSED(dataLost)
if (channel.GetChannelInfo().iChannelType == KSensrvChannelTypeIdOrientationData) {
TSensrvOrientationData data;
for (int i = 0; i < count; ++i) {
TPckgBuf<TSensrvOrientationData> dataBuf;
channel.GetData(dataBuf);
data = dataBuf();
- Orientation o = UnknownOrientation;
+ Orientation orientation = UnknownOrientation;
switch (data.iDeviceOrientation) {
case TSensrvOrientationData::EOrientationDisplayUp:
- o = Portrait;
+ orientation = Portrait;
break;
case TSensrvOrientationData::EOrientationDisplayRightUp:
- o = Landscape;
+ orientation = Landscape;
break;
case TSensrvOrientationData::EOrientationDisplayLeftUp:
+ orientation = LandscapeInverted;
+ break;
case TSensrvOrientationData::EOrientationDisplayDown:
+ orientation = PortraitInverted;
+ break;
case TSensrvOrientationData::EOrientationUndefined:
case TSensrvOrientationData::EOrientationDisplayUpwards:
case TSensrvOrientationData::EOrientationDisplayDownwards:
@@ -133,8 +138,8 @@ private:
break;
}
- if (m_current != o && o != UnknownOrientation) {
- m_current = o;
+ if (m_current != orientation && orientation != UnknownOrientation) {
+ m_current = orientation;
emit orientationChanged();
}
}