From cb6472cb67511316f058b1eda4ffe71a1c4fe019 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 13 Jul 2010 15:50:22 +1000 Subject: Only support portrait and landscape orientations on Symbian when updating the runtime.orientation property Task-number: QTBUG-12036 Reviewed-by: Martin Jones --- tools/qml/deviceorientation_symbian.cpp | 12 ++++-------- tools/qml/main.cpp | 11 ++--------- tools/qml/qml.pro | 1 - 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/tools/qml/deviceorientation_symbian.cpp b/tools/qml/deviceorientation_symbian.cpp index 48bfc72..c305f94 100644 --- a/tools/qml/deviceorientation_symbian.cpp +++ b/tools/qml/deviceorientation_symbian.cpp @@ -118,18 +118,14 @@ private: data = dataBuf(); Orientation o = UnknownOrientation; switch (data.iDeviceOrientation) { - case TSensrvOrientationData::EOrientationDisplayRightUp: - o = LandscapeInverted; - break; case TSensrvOrientationData::EOrientationDisplayUp: o = Portrait; break; - case TSensrvOrientationData::EOrientationDisplayDown: - o = PortraitInverted; - break; - case TSensrvOrientationData::EOrientationDisplayLeftUp: + case TSensrvOrientationData::EOrientationDisplayRightUp: o = Landscape; break; + case TSensrvOrientationData::EOrientationDisplayLeftUp: + case TSensrvOrientationData::EOrientationDisplayDown: case TSensrvOrientationData::EOrientationUndefined: case TSensrvOrientationData::EOrientationDisplayUpwards: case TSensrvOrientationData::EOrientationDisplayDownwards: @@ -137,7 +133,7 @@ private: break; } - if (m_current != o) { + if (m_current != o && o != UnknownOrientation) { m_current = o; emit orientationChanged(); } diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index dfd1726..4b1162e 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -56,9 +56,7 @@ QT_USE_NAMESPACE QtMsgHandler systemMsgOutput = 0; -#if defined(Q_WS_S60) -#include // For locking app to portrait -#endif + #if defined (Q_OS_SYMBIAN) #include @@ -211,12 +209,7 @@ int main(int argc, char ** argv) app.setOrganizationName("Nokia"); app.setOrganizationDomain("nokia.com"); -#if defined(Q_WS_S60) - CAknAppUi *appUi = static_cast(CEikonEnv::Static()->AppUi()); - if (appUi) { - appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait); - } -#endif + QDeclarativeViewer::registerTypes(); QDeclarativeTester::registerTypes(); diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index 0a51c0b..bb69e8a 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -39,7 +39,6 @@ symbian { TARGET.CAPABILITY = NetworkServices ReadUserData !contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) { LIBS += -lsensrvclient -lsensrvutil - contains(QT_CONFIG, s60): LIBS += -lavkon -lcone } } mac { -- cgit v0.12