Index: trunk/src/mainwindow.cpp
===================================================================
--- trunk/src/mainwindow.cpp	(revision 134)
+++ trunk/src/mainwindow.cpp	(revision 135)
@@ -711,8 +711,12 @@
 		QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 
+#ifndef QT_NO_CONCURRENT
 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
 		while (!f.isFinished()) {
 			QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 		}
+#else
+		solver.cleanup(true);
+#endif
 		pd.reset();
 #ifdef Q_OS_WIN32
@@ -742,5 +746,5 @@
 		pic.begin(&graph);
 		pic.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
-QFont font = settings->value("Output/Font", QFont(DEF_FONT_FACE, 9)).value<QFont>();
+QFont font = qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE, 9)));
 		if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) {
 			font.setWeight(QFont::DemiBold);
@@ -792,8 +796,12 @@
 				tl->SetProgressState(winId(), TBPF_INDETERMINATE);
 #endif
+#ifndef QT_NO_CONCURRENT
 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
 			while (!f.isFinished()) {
 				QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 			}
+#else
+			solver.cleanup(true);
+#endif
 			solutionText->clear();
 			toggleSolutionActions(false);
@@ -920,8 +928,12 @@
 		tl->SetProgressState(winId(), TBPF_INDETERMINATE);
 #endif
+#ifndef QT_NO_CONCURRENT
 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
 	while (!f.isFinished()) {
 		QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 	}
+#else
+	solver.cleanup(true);
+#endif
 	toggleSolutionActions();
 	tabWidget->setCurrentIndex(1);
@@ -1045,4 +1057,6 @@
 			settings->endGroup();
 		}
+#else
+		settings->setValue("MainWindow/ToolbarVisible", toolBarMain->isVisible());
 #endif // HANDHELD
 	} else {
@@ -1139,5 +1153,5 @@
 void MainWindow::initDocStyleSheet()
 {
-	solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)).value<QFont>());
+	solutionText->document()->setDefaultFont(qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE))));
 
 	fmt_paragraph.setTopMargin(0);
@@ -1158,5 +1172,5 @@
 	settings->beginGroup("Output/Colors");
 
-QColor color = settings->value("Text", DEF_TEXT_COLOR).value<QColor>();
+QColor color = qvariant_cast<QColor>(settings->value("Text", DEF_TEXT_COLOR));
 QColor hilight;
 	if (color.value() < 192)
@@ -1168,8 +1182,8 @@
 	fmt_default.setForeground(QBrush(color));
 
-	fmt_selected.setForeground(QBrush(settings->value("Selected", DEF_SELECTED_COLOR).value<QColor>()));
+	fmt_selected.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Selected", DEF_SELECTED_COLOR))));
 	fmt_selected.setFontWeight(QFont::Bold);
 
-	fmt_alternate.setForeground(QBrush(settings->value("Alternate", DEF_ALTERNATE_COLOR).value<QColor>()));
+	fmt_alternate.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Alternate", DEF_ALTERNATE_COLOR))));
 	fmt_alternate.setFontWeight(QFont::Bold);
 	fmt_altlist.setForeground(QBrush(hilight));
@@ -1398,5 +1412,5 @@
 {
 	if (all)
-		Ui::MainWindow::retranslateUi(this);
+		Ui_MainWindow::retranslateUi(this);
 
 	loadStyleList();
@@ -1474,5 +1488,5 @@
 void MainWindow::setupUi()
 {
-	Ui::MainWindow::setupUi(this);
+	Ui_MainWindow::setupUi(this);
 
 	// File Menu
@@ -1480,15 +1494,25 @@
 	actionFileOpen->setIcon(GET_ICON("document-open"));
 	actionFileSave->setIcon(GET_ICON("document-save"));
+#ifndef HANDHELD
 	menuFileSaveAs->setIcon(GET_ICON("document-save-as"));
+#endif
 	actionFileExit->setIcon(GET_ICON("application-exit"));
 	// Settings Menu
+#ifndef HANDHELD
 	menuSettingsLanguage->setIcon(GET_ICON("preferences-desktop-locale"));
-	actionSettingsLanguageEnglish->setIcon(GET_ICON("flag-gb"));
+#if QT_VERSION >= 0x040600
+	actionSettingsLanguageEnglish->setIcon(QIcon::fromTheme("flag-gb", QIcon(":/images/icons/l10n/flag-gb.png")));
+#else // QT_VERSION >= 0x040600
+	actionSettingsLanguageEnglish->setIcon(QIcon(":/images/icons/l10n/flag-gb.png"));
+#endif // QT_VERSION >= 0x040600
 	menuSettingsStyle->setIcon(GET_ICON("preferences-desktop-theme"));
+#endif // HANDHELD
 	actionSettingsPreferences->setIcon(GET_ICON("preferences-system"));
 	// Help Menu
+#ifndef HANDHELD
 	actionHelpContents->setIcon(GET_ICON("help-contents"));
 	actionHelpContextual->setIcon(GET_ICON("help-contextual"));
 	actionHelpAbout->setIcon(GET_ICON("help-about"));
+#endif
 	// Buttons
 	buttonRandom->setIcon(GET_ICON("roll"));
@@ -1589,4 +1613,6 @@
 //	toolBarManager->addAction(action, cat);
 	toolBarManager->restoreState(settings->value("MainWindow/Toolbars").toByteArray());
+#else
+	toolBarMain->setVisible(settings->value("MainWindow/ToolbarVisible", true).toBool());
 #endif // HANDHELD
 
