Merge branch 'master' of https://vcs.maemo.org/git/vlc-remote
[vlc-remote] / main.cpp
index 6c74fa1..8e21758 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -50,7 +50,21 @@ int main(int argc, char *argv[])
 
   mainwindow->showMaximized();
  #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
-mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+  Orientation o = AppSettings::getOrientation();
+  switch (o) {
+      case AUTO_ROTATE:
+      mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+          break;
+      case LANDSCAPE:
+          mainwindow->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
+          break;
+      case PORTRAIT:
+          mainwindow->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+          break;
+      default:
+          mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+          break;
+  }
 #endif
     return a.exec();
 }