summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriano Rezende <adriano.rezende@openbossa.org>2009-11-17 14:42:17 -0300
committerAdriano Rezende <adriano.rezende@openbossa.org>2009-11-17 14:42:17 -0300
commita382fce5f05a6d19677d06bc220a33b667969842 (patch)
treee7570ef12ee44c5ca7fcc2d0fd4be93ac83bc88a
parent4b5933299f07c0bb9e0f29f750cc6a9d6bca56e8 (diff)
Weather: Adjusted code to use System from shared
Signed-off-by: Adriano Rezende <adriano.rezende@openbossa.org>
-rw-r--r--weather/main.cpp4
-rw-r--r--weather/settings.cpp21
-rw-r--r--weather/settings.h5
-rw-r--r--weather/weather.pro3
4 files changed, 6 insertions, 27 deletions
diff --git a/weather/main.cpp b/weather/main.cpp
index 3925fda..0574b93 100644
--- a/weather/main.cpp
+++ b/weather/main.cpp
@@ -36,6 +36,7 @@
#include <QSettings>
#include <QDebug>
+#include "system.h"
#include "mainview.h"
#include "forecastdata.h"
#include "settings.h"
@@ -59,11 +60,12 @@ int main(int argc, char **argv)
#ifdef Q_OS_SYMBIAN
const bool connected = connect();
- Settings::fixedPortraitOrientation();
#else
const bool connected = true;
#endif
+ System::setViewMode(System::PortraitMode);
+
if (connected)
ForecastProvider::setForecastSource(new NetworkForecastSource());
else
diff --git a/weather/settings.cpp b/weather/settings.cpp
index 49061ba..fe1008a 100644
--- a/weather/settings.cpp
+++ b/weather/settings.cpp
@@ -36,10 +36,6 @@
#include <QDebug>
#ifdef Q_OS_SYMBIAN
-#include <eikenv.h>
-#include <coemain.h>
-#include <aknappui.h>
-
#define SETTINGS_FILE "c://data/weather.ini"
#else
#define SETTINGS_FILE "weather.ini"
@@ -122,20 +118,3 @@ void Settings::setCurrentCities(QStringList cities)
obj->m_settings.endGroup();
obj->m_settings.sync();
}
-
-void Settings::configPortrait()
-{
-#ifdef Q_OS_SYMBIAN
- CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
- if (appUi) {
- appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
- }
-#endif
-}
-
-void Settings::fixedPortraitOrientation()
-{
-#ifdef Q_OS_SYMBIAN
- QTimer::singleShot(1, instance(), SLOT(configPortrait()));
-#endif
-}
diff --git a/weather/settings.h b/weather/settings.h
index a54ea64..7556e72 100644
--- a/weather/settings.h
+++ b/weather/settings.h
@@ -46,8 +46,6 @@ public:
static QString elementPath(const QString & element)
{ return ":images/weather_elements/" + element; }
- static void fixedPortraitOrientation();
-
static QSize windowSize();
static bool scaledImages();
@@ -64,9 +62,6 @@ public:
static QStringList getCurrentCities();
static void setCurrentCities(QStringList cities);
-private slots:
- void configPortrait();
-
private:
QSettings m_settings;
static Settings *instance();
diff --git a/weather/weather.pro b/weather/weather.pro
index 13e46c1..2a16410 100644
--- a/weather/weather.pro
+++ b/weather/weather.pro
@@ -6,6 +6,9 @@ target.path = $$PREFIX/bin
INSTALLS += target
RESOURCES += resources.qrc
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
+
+include(../shared/shared.pri)
+
symbian {
LIBS += -lesock \
-lconnmon \