Index: trunk/src/mainwindow.cpp
===================================================================
--- trunk/src/mainwindow.cpp	(revision 140)
+++ trunk/src/mainwindow.cpp	(revision 141)
@@ -24,5 +24,5 @@
 #include "mainwindow.h"
 
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	#include "shobjidl.h"
 #endif
@@ -63,9 +63,9 @@
 #endif // QT_NO_PRINTER
 
-#ifdef Q_OS_WINCE_WM
+#ifdef Q_WS_WINCE_WM
 	currentGeometry = QApplication::desktop()->availableGeometry(0);
 	// We need to react to SIP show/hide and resize the window appropriately
 	connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int)));
-#endif // Q_OS_WINCE_WM
+#endif // Q_WS_WINCE_WM
 	connect(actionFileNew, SIGNAL(triggered()), SLOT(actionFileNewTriggered()));
 	connect(actionFileOpen, SIGNAL(triggered()), SLOT(actionFileOpenTriggered()));
@@ -372,4 +372,5 @@
 void MainWindow::groupSettingsLanguageListTriggered(QAction *action)
 {
+#ifndef Q_WS_MAEMO_5
 	if (actionSettingsLanguageAutodetect->isChecked()) {
 		// We have language autodetection. It needs to be disabled to change language.
@@ -379,4 +380,5 @@
 			return;
 	}
+#endif
 bool untitled = (fileName == tr("Untitled") + ".tspt");
 	if (loadLanguage(action->data().toString())) {
@@ -386,5 +388,5 @@
 		if (untitled)
 			setFileName();
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 		if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
 			toggleStyle(labelVariant, true);
@@ -565,7 +567,7 @@
 	hb2->addWidget(bb);
 
-#ifdef Q_OS_WINCE_WM
+#ifdef Q_WS_WINCE_WM
 	vb->setMargin(3);
-#endif // Q_OS_WINCE_WM
+#endif // Q_WS_WINCE_WM
 	vb->addLayout(hb1);
 #ifdef HANDHELD
@@ -600,10 +602,10 @@
 	connect(bb, SIGNAL(accepted()), dlg, SLOT(accept()));
 
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	// Adding some eyecandy in Vista and 7 :-)
 	if (QtWin::isCompositionEnabled())  {
 		QtWin::enableBlurBehindWindow(dlg, true);
 	}
-#endif // Q_OS_WIN32
+#endif // Q_WS_WIN32
 
 	dlg->resize(450, 350);
@@ -662,5 +664,5 @@
 	pd.show();
 
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (LPVOID*)&tl);
 	if (SUCCEEDED(hr)) {
@@ -680,10 +682,10 @@
 	connect(&solver, SIGNAL(routePartFound(int)), &pd, SLOT(setValue(int)));
 	connect(&pd, SIGNAL(canceled()), &solver, SLOT(cancel()));
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	if (tl != NULL)
 		connect(&solver, SIGNAL(routePartFound(int)), SLOT(solverRoutePartFound(int)));
 #endif
 SStep *root = solver.solve(n, matrix);
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	if (tl != NULL)
 		disconnect(&solver, SIGNAL(routePartFound(int)), this, SLOT(solverRoutePartFound(int)));
@@ -694,5 +696,5 @@
 		pd.reset();
 		if (!solver.wasCanceled()) {
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 			if (tl != NULL) {
 //				tl->SetProgressValue(winId(), n, n * 2);
@@ -707,5 +709,5 @@
 		pd.setCancelButton(NULL);
 		pd.show();
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 		if (tl != NULL)
 			tl->SetProgressState(winId(), TBPF_INDETERMINATE);
@@ -722,5 +724,5 @@
 #endif
 		pd.reset();
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 		if (tl != NULL) {
 			tl->SetProgressState(winId(), TBPF_NOPROGRESS);
@@ -736,5 +738,5 @@
 	pd.setValue(0);
 
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	if (tl != NULL)
 		tl->SetProgressValue(winId(), spinCities->value(), spinCities->value() + solver.getTotalSteps() + 1);
@@ -794,5 +796,5 @@
 			pd.show();
 			QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 			if (tl != NULL)
 				tl->SetProgressState(winId(), TBPF_INDETERMINATE);
@@ -808,5 +810,5 @@
 			solutionText->clear();
 			toggleSolutionActions(false);
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 			if (tl != NULL) {
 				tl->SetProgressState(winId(), TBPF_NOPROGRESS);
@@ -818,5 +820,5 @@
 		}
 		pd.setValue(n);
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 		if (tl != NULL)
 			tl->SetProgressValue(winId(), spinCities->value() + n, spinCities->value() + solver.getTotalSteps() + 1);
@@ -864,5 +866,5 @@
 	pb->setFormat(tr("Generating footer"));
 	pd.setValue(n);
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	if (tl != NULL)
 		tl->SetProgressValue(winId(), spinCities->value() + n, spinCities->value() + solver.getTotalSteps() + 1);
@@ -926,5 +928,5 @@
 	pd.setCancelButton(NULL);
 	QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	if (tl != NULL)
 		tl->SetProgressState(winId(), TBPF_INDETERMINATE);
@@ -940,5 +942,5 @@
 	toggleSolutionActions();
 	tabWidget->setCurrentIndex(1);
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	if (tl != NULL) {
 		tl->SetProgressState(winId(), TBPF_NOPROGRESS);
@@ -968,5 +970,5 @@
 }
 
-#ifdef Q_OS_WINCE_WM
+#ifdef Q_WS_WINCE_WM
 void MainWindow::changeEvent(QEvent *ev)
 {
@@ -1001,5 +1003,5 @@
 	}
 }
-#endif // Q_OS_WINCE_WM
+#endif // Q_WS_WINCE_WM
 
 void MainWindow::numCitiesChanged(int nCities)
@@ -1017,14 +1019,14 @@
 #endif // QT_NO_PRINTER
 
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 void MainWindow::solverRoutePartFound(int n)
 {
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	tl->SetProgressValue(winId(), n, spinCities->value() * 2);
 #else
 	Q_UNUSED(n);
-#endif // Q_OS_WIN32
-}
-#endif // Q_OS_WIN32
+#endif // Q_WS_WIN32
+}
+#endif // Q_WS_WIN32
 
 void MainWindow::spinCitiesValueChanged(int n)
@@ -1043,5 +1045,5 @@
 void MainWindow::check4Updates(bool silent)
 {
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	if (silent)
 		QProcess::startDetached("updater/Update.exe -name=\"TSPSG: TSP Solver and Generator\" -check=\"freeupdate\" -silentcheck");
@@ -1260,5 +1262,5 @@
 QString lng = lang;
 	if (lng.isEmpty()) {
-		ad = settings->value("Language", "").toString().isEmpty();
+		ad = settings->value("Language").toString().isEmpty();
 		lng = settings->value("Language", QLocale::system().name()).toString();
 	}
@@ -1334,6 +1336,9 @@
 		a->setCheckable(true);
 		a->setActionGroup(groupSettingsStyleList);
-		if ((style == settings->value("Style").toString())
-			|| QString(QApplication::style()->metaObject()->className()).contains(QRegExp(QString("^Q?%1(Style)?$").arg(QRegExp::escape(style)), Qt::CaseInsensitive))) {
+		if ((style == settings->value("Stlye").toString())
+#ifndef Q_WS_MAEMO_5
+			|| QString(QApplication::style()->metaObject()->className()).contains(QRegExp(QString("^Q?%1(Style)?$").arg(QRegExp::escape(style)), Qt::CaseInsensitive))
+#endif
+		) {
 			a->setChecked(true);
 		}
@@ -1543,5 +1548,5 @@
 #endif // HANDHELD
 
-#ifdef Q_OS_WINCE_WM
+#ifdef Q_WS_WINCE_WM
 	menuBar()->setDefaultAction(menuFile->menuAction());
 
@@ -1554,8 +1559,8 @@
 #else
 	setCentralWidget(tabWidget);
-#endif // Q_OS_WINCE_WM
+#endif // Q_WS_WINCE_WM
 
 	//! \hack HACK: A little hack for toolbar icons to have a sane size.
-#ifdef HANDHELD
+#if defined(HANDHELD) && !defined(Q_WS_MAEMO_5)
 	toolBarMain->setIconSize(QSize(logicalDpiX() / 4, logicalDpiY() / 4));
 #endif // HANDHELD
@@ -1588,4 +1593,7 @@
 
 	groupSettingsLanguageList = new QActionGroup(this);
+#ifdef Q_WS_MAEMO_5
+	groupSettingsLanguageList->addAction(actionSettingsLanguageAutodetect);
+#endif
 	actionSettingsLanguageEnglish->setData("en");
 	actionSettingsLanguageEnglish->setActionGroup(groupSettingsLanguageList);
@@ -1595,4 +1603,7 @@
 	actionSettingsStyleSystem->setData(true);
 	groupSettingsStyleList = new QActionGroup(this);
+#ifdef Q_WS_MAEMO_5
+	groupSettingsStyleList->addAction(actionSettingsStyleSystem);
+#endif
 
 #ifndef HANDHELD
@@ -1630,10 +1641,10 @@
 	retranslateUi(false);
 
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	// Adding some eyecandy in Vista and 7 :-)
 	if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
 		toggleTranclucency(true);
 	}
-#endif // Q_OS_WIN32
+#endif // Q_WS_WIN32
 }
 
@@ -1651,5 +1662,5 @@
 void MainWindow::toggleTranclucency(bool enable)
 {
-#ifdef Q_OS_WIN32
+#ifdef Q_WS_WIN32
 	toggleStyle(labelVariant, enable);
 	toggleStyle(labelCities, enable);
@@ -1659,4 +1670,4 @@
 #else
 	Q_UNUSED(enable);
-#endif // Q_OS_WIN32
-}
+#endif // Q_WS_WIN32
+}
