Index: /trunk/src/defaults.h
===================================================================
--- /trunk/src/defaults.h	(revision 148)
+++ /trunk/src/defaults.h	(revision 149)
@@ -43,7 +43,7 @@
  */
 #ifdef Q_WS_WINCE_WM
-	#define DEF_USE_NATIVE_DIALOGS false
+#   define DEF_USE_NATIVE_DIALOGS false
 #else
-	#define DEF_USE_NATIVE_DIALOGS true
+#   define DEF_USE_NATIVE_DIALOGS true
 #endif // Q_WS_WINCE_WM
 //! Default for "Save main window state and position"
@@ -92,7 +92,7 @@
  */
 #ifdef Q_WS_S60
-	#define DEF_FONT_SIZE 8
+#   define DEF_FONT_SIZE 8
 #else
-	#define DEF_FONT_SIZE 10
+#   define DEF_FONT_SIZE 10
 #endif // Q_WS_S60
 //! Default text color
Index: /trunk/src/globals.cpp
===================================================================
--- /trunk/src/globals.cpp	(revision 148)
+++ /trunk/src/globals.cpp	(revision 149)
@@ -27,9 +27,9 @@
 void toggleStyle(QWidget *widget, bool enable)
 {
-	if (enable) {
-		widget->setStyleSheet(QString("%1 {background-color: %2; border-color: %3; border-width: 1px; border-style: solid; border-radius: 3px;}").arg(widget->metaObject()->className(), widget->palette().window().color().name(), widget->palette().shadow().color().name()));
-	} else {
-		widget->setStyleSheet(QString());
-	}
+    if (enable) {
+        widget->setStyleSheet(QString("%1 {background-color: %2; border-color: %3; border-width: 1px; border-style: solid; border-radius: 3px;}").arg(widget->metaObject()->className(), widget->palette().window().color().name(), widget->palette().shadow().color().name()));
+    } else {
+        widget->setStyleSheet(QString());
+    }
 }
 #endif // Q_WS_WIN32
Index: /trunk/src/globals.h
===================================================================
--- /trunk/src/globals.h	(revision 148)
+++ /trunk/src/globals.h	(revision 149)
@@ -32,21 +32,21 @@
 #include <QtCore>
 #if QT_VERSION < 0x040500
-	#error You are using Qt version < 4.5 but minimum required version is 4.5.0. Compilation aborted.
+#   error You are using Qt version < 4.5 but minimum required version is 4.5.0. Compilation aborted.
 #endif
 #if defined(Q_WS_WINCE_WM) || defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
-	//! This is defined on handheld devices (e.g., Windows Mobile, Symbian).
-	#define HANDHELD
-	#define QT_NO_STATUSTIP
+    //! This is defined on handheld devices (e.g., Windows Mobile, Symbian).
+#   define HANDHELD
+#   define QT_NO_STATUSTIP
 #endif
 #include <QtGui>
 #if defined(QT_NO_SVG) && !defined(NOSVG)
-	#define NOSVG
+#   define NOSVG
 #endif
 #if !defined(NOSVG)
-	#include <QtSvg>
+#   include <QtSvg>
 #endif // NOSVG
 
 #ifndef HANDHELD
-	#include "qttoolbardialog.h"
+#   include "qttoolbardialog.h"
 #endif
 
@@ -60,6 +60,6 @@
 #include "tspsolver.h"
 #ifdef Q_WS_WIN32
-	// Vista/7 Eyecandy
-	#include "qtwin.h"
+    // Vista/7 Eyecandy
+#   include "qtwin.h"
 #endif // Q_WS_WIN32
 
@@ -76,5 +76,5 @@
  */
 #ifndef PATH_L10N
-	#define PATH_L10N "l10n"
+#   define PATH_L10N "l10n"
 #endif // PATH_L10N
 /*!
@@ -83,5 +83,5 @@
  */
 #ifndef PATH_DOCS
-	#define PATH_DOCS "help"
+#   define PATH_DOCS "help"
 #endif // PATH_DOCS
 
@@ -111,5 +111,5 @@
 {
 double i;
-	return (modf(x, &i) == 0.0);
+    return (modf(x, &i) == 0.0);
 }
 
@@ -123,7 +123,7 @@
 {
 #ifdef Q_WS_WIN32
-	return QFile::exists("updater/Update.exe");
+    return QFile::exists("updater/Update.exe");
 #else // Q_WS_WIN32
-	return false;
+    return false;
 #endif // Q_WS_WIN32
 }
@@ -143,15 +143,15 @@
 
 #ifdef HANDHELD
-	#define ICON_SIZE "32x32"
-	#define ICON_FORMAT "png"
+#   define ICON_SIZE "32x32"
+#   define ICON_FORMAT "png"
 #else
-	#define ICON_SIZE "128x128"
-	#define ICON_FORMAT "png"
+#   define ICON_SIZE "128x128"
+#   define ICON_FORMAT "png"
 #endif
 
 #if QT_VERSION >= 0x040600
-	#define GET_ICON(x) QIcon::fromTheme(x, QIcon(":/images/icons/"ICON_SIZE"/"x"."ICON_FORMAT))
+#   define GET_ICON(x) QIcon::fromTheme(x, QIcon(":/images/icons/"ICON_SIZE"/"x"."ICON_FORMAT))
 #else
-	#define GET_ICON(x) QIcon(":/images/icons/"ICON_SIZE"/"x"."ICON_FORMAT)
+#   define GET_ICON(x) QIcon(":/images/icons/"ICON_SIZE"/"x"."ICON_FORMAT)
 #endif
 
@@ -159,16 +159,16 @@
 // Check that default number of cities is sane (<= MAX_NUM_CITIES)
 #if DEF_NUM_CITIES > MAX_NUM_CITIES
-	#undef DEF_NUM_CITIES
-	#define DEF_NUM_CITIES MAX_NUM_CITIES
+#   undef DEF_NUM_CITIES
+#   define DEF_NUM_CITIES MAX_NUM_CITIES
 #endif
 // Check that maximum for random generation is sane (<= MAX_RAND_VALUE)
 #if DEF_RAND_MAX > MAX_RAND_VALUE
-	#undef DEF_RAND_MAX
-	#define DEF_RAND_MAX MAX_RAND_VALUE
+#   undef DEF_RAND_MAX
+#   define DEF_RAND_MAX MAX_RAND_VALUE
 #endif
 // Check that DEF_RAND_MIN <= DEF_RAND_MAX
 #if DEF_RAND_MIN > DEF_RAND_MAX
-	#undef DEF_RAND_MIN
-	#define DEF_RAND_MIN DEF_RAND_MAX
+#   undef DEF_RAND_MIN
+#   define DEF_RAND_MIN DEF_RAND_MAX
 #endif
 
Index: /trunk/src/main.cpp
===================================================================
--- /trunk/src/main.cpp	(revision 148)
+++ /trunk/src/main.cpp	(revision 149)
@@ -24,11 +24,11 @@
 #include "mainwindow.h"
 #if QT_VERSION < 0x040600
-	#ifdef Q_CC_MSVC
-		#pragma message("WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.")
-	#elif defined(Q_CC_GNU)
-		#warning WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.
-	#else
-		#error You are using Qt version < 4.6. Application will not support some non-critical features. To continue, please, comment line 31 at main.cpp.
-	#endif
+#   ifdef Q_CC_MSVC
+#       pragma message("WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.")
+#   elif defined(Q_CC_GNU)
+#       warning WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.
+#   else
+#       error You are using Qt version < 4.6. Application will not support some non-critical features. To continue, please, comment line 31 at main.cpp.
+#   endif
 #endif
 
@@ -42,40 +42,40 @@
 {
 QApplication app(argc, argv);
-	app.setOverrideCursor(QCursor(Qt::WaitCursor));
-	QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8"));
-	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8"));
-	QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
-	app.setOrganizationName("Oleksii \"Lёppa\" Serdiuk");
-	app.setOrganizationDomain("oleksii.name");
-	app.setApplicationName("TSP Solver and Generator");
-	app.setApplicationVersion(BUILD_VERSION);
+    app.setOverrideCursor(QCursor(Qt::WaitCursor));
+    QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8"));
+    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8"));
+    QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
+    app.setOrganizationName("Oleksii \"Lёppa\" Serdiuk");
+    app.setOrganizationDomain("oleksii.name");
+    app.setApplicationName("TSP Solver and Generator");
+    app.setApplicationVersion(BUILD_VERSION);
 
-	// Seeding random number generator
-	qsrand(QDateTime::currentDateTime().toTime_t() ^ QCursor::pos().x() ^ QCursor::pos().y());
+    // Seeding random number generator
+    qsrand(QDateTime::currentDateTime().toTime_t() ^ QCursor::pos().x() ^ QCursor::pos().y());
 
 #ifdef Q_WS_WINCE_WM
-	// Qt "leaves" unpacked .ttf files after running - let's try to delete them.
+    // Qt "leaves" unpacked .ttf files after running - let's try to delete them.
 QStringList files = QDir(app.applicationDirPath(), "*.ttf").entryList();
-	foreach (QString file, files) {
-		QFile::remove(file);
-	}
+    foreach (QString file, files) {
+        QFile::remove(file);
+    }
 #endif
-	// Don't load the font if it is already available
-	if (!QFontDatabase().families().contains(DEF_FONT_FACE))
-		QFontDatabase::addApplicationFont(":/files/DejaVuLGCSansMono.ttf");
+    // Don't load the font if it is already available
+    if (!QFontDatabase().families().contains(DEF_FONT_FACE))
+        QFontDatabase::addApplicationFont(":/files/DejaVuLGCSansMono.ttf");
 
 QTranslator en;
-	if (en.load("tspsg_en", PATH_L10N))
-		app.installTranslator(&en);
-	else if (en.load("tspsg_en", ":/l10n"))
-		app.installTranslator(&en);
+    if (en.load("tspsg_en", PATH_L10N))
+        app.installTranslator(&en);
+    else if (en.load("tspsg_en", ":/l10n"))
+        app.installTranslator(&en);
 
 MainWindow mainwindow;
 #ifdef HANDHELD
-	mainwindow.showMaximized();
+    mainwindow.showMaximized();
 #else // HANDHELD
-	mainwindow.show();
+    mainwindow.show();
 #endif // HANDHELD
-	app.restoreOverrideCursor();
-	return app.exec();
+    app.restoreOverrideCursor();
+    return app.exec();
 }
Index: /trunk/src/mainwindow.cpp
===================================================================
--- /trunk/src/mainwindow.cpp	(revision 148)
+++ /trunk/src/mainwindow.cpp	(revision 149)
@@ -25,5 +25,5 @@
 
 #ifdef Q_WS_WIN32
-	#include "shobjidl.h"
+    #include "shobjidl.h"
 #endif
 
@@ -41,104 +41,104 @@
  */
 MainWindow::MainWindow(QWidget *parent)
-	: QMainWindow(parent)
-{
-	settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
-
-	if (settings->contains("Style")) {
+    : QMainWindow(parent)
+{
+    settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
+
+    if (settings->contains("Style")) {
 QStyle *s = QStyleFactory::create(settings->value("Style").toString());
-		if (s != NULL)
-			QApplication::setStyle(s);
-		else
-			settings->remove("Style");
-	}
-
-	loadLanguage();
-	setupUi();
-	setAcceptDrops(true);
-
-	initDocStyleSheet();
+        if (s != NULL)
+            QApplication::setStyle(s);
+        else
+            settings->remove("Style");
+    }
+
+    loadLanguage();
+    setupUi();
+    setAcceptDrops(true);
+
+    initDocStyleSheet();
 
 #ifndef QT_NO_PRINTER
-	printer = new QPrinter(QPrinter::HighResolution);
+    printer = new QPrinter(QPrinter::HighResolution);
 #endif // QT_NO_PRINTER
 
 #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)));
+    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_WS_WINCE_WM
-	connect(actionFileNew, SIGNAL(triggered()), SLOT(actionFileNewTriggered()));
-	connect(actionFileOpen, SIGNAL(triggered()), SLOT(actionFileOpenTriggered()));
-	connect(actionFileSave, SIGNAL(triggered()), SLOT(actionFileSaveTriggered()));
-	connect(actionFileSaveAsTask, SIGNAL(triggered()), SLOT(actionFileSaveAsTaskTriggered()));
-	connect(actionFileSaveAsSolution, SIGNAL(triggered()), SLOT(actionFileSaveAsSolutionTriggered()));
+    connect(actionFileNew, SIGNAL(triggered()), SLOT(actionFileNewTriggered()));
+    connect(actionFileOpen, SIGNAL(triggered()), SLOT(actionFileOpenTriggered()));
+    connect(actionFileSave, SIGNAL(triggered()), SLOT(actionFileSaveTriggered()));
+    connect(actionFileSaveAsTask, SIGNAL(triggered()), SLOT(actionFileSaveAsTaskTriggered()));
+    connect(actionFileSaveAsSolution, SIGNAL(triggered()), SLOT(actionFileSaveAsSolutionTriggered()));
 #ifndef QT_NO_PRINTER
-	connect(actionFilePrintPreview, SIGNAL(triggered()), SLOT(actionFilePrintPreviewTriggered()));
-	connect(actionFilePrint, SIGNAL(triggered()), SLOT(actionFilePrintTriggered()));
+    connect(actionFilePrintPreview, SIGNAL(triggered()), SLOT(actionFilePrintPreviewTriggered()));
+    connect(actionFilePrint, SIGNAL(triggered()), SLOT(actionFilePrintTriggered()));
 #endif // QT_NO_PRINTER
 #ifndef HANDHELD
-	connect(actionSettingsToolbarsConfigure, SIGNAL(triggered()), SLOT(actionSettingsToolbarsConfigureTriggered()));
+    connect(actionSettingsToolbarsConfigure, SIGNAL(triggered()), SLOT(actionSettingsToolbarsConfigureTriggered()));
 #endif // HANDHELD
-	connect(actionSettingsPreferences, SIGNAL(triggered()), SLOT(actionSettingsPreferencesTriggered()));
-	if (actionHelpCheck4Updates != NULL)
-		connect(actionHelpCheck4Updates, SIGNAL(triggered()), SLOT(actionHelpCheck4UpdatesTriggered()));
-	connect(actionSettingsLanguageAutodetect, SIGNAL(triggered(bool)), SLOT(actionSettingsLanguageAutodetectTriggered(bool)));
-	connect(groupSettingsLanguageList, SIGNAL(triggered(QAction *)), SLOT(groupSettingsLanguageListTriggered(QAction *)));
-	connect(actionSettingsStyleSystem, SIGNAL(triggered(bool)), SLOT(actionSettingsStyleSystemTriggered(bool)));
-	connect(groupSettingsStyleList, SIGNAL(triggered(QAction*)), SLOT(groupSettingsStyleListTriggered(QAction*)));
-	connect(actionHelpOnlineSupport, SIGNAL(triggered()), SLOT(actionHelpOnlineSupportTriggered()));
-	connect(actionHelpReportBug, SIGNAL(triggered()), SLOT(actionHelpReportBugTriggered()));
-	connect(actionHelpAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-	connect(actionHelpAbout, SIGNAL(triggered()), SLOT(actionHelpAboutTriggered()));
-
-	connect(buttonSolve, SIGNAL(clicked()), SLOT(buttonSolveClicked()));
-	connect(buttonRandom, SIGNAL(clicked()), SLOT(buttonRandomClicked()));
-	connect(buttonBackToTask, SIGNAL(clicked()), SLOT(buttonBackToTaskClicked()));
-	connect(spinCities, SIGNAL(valueChanged(int)), SLOT(spinCitiesValueChanged(int)));
+    connect(actionSettingsPreferences, SIGNAL(triggered()), SLOT(actionSettingsPreferencesTriggered()));
+    if (actionHelpCheck4Updates != NULL)
+        connect(actionHelpCheck4Updates, SIGNAL(triggered()), SLOT(actionHelpCheck4UpdatesTriggered()));
+    connect(actionSettingsLanguageAutodetect, SIGNAL(triggered(bool)), SLOT(actionSettingsLanguageAutodetectTriggered(bool)));
+    connect(groupSettingsLanguageList, SIGNAL(triggered(QAction *)), SLOT(groupSettingsLanguageListTriggered(QAction *)));
+    connect(actionSettingsStyleSystem, SIGNAL(triggered(bool)), SLOT(actionSettingsStyleSystemTriggered(bool)));
+    connect(groupSettingsStyleList, SIGNAL(triggered(QAction*)), SLOT(groupSettingsStyleListTriggered(QAction*)));
+    connect(actionHelpOnlineSupport, SIGNAL(triggered()), SLOT(actionHelpOnlineSupportTriggered()));
+    connect(actionHelpReportBug, SIGNAL(triggered()), SLOT(actionHelpReportBugTriggered()));
+    connect(actionHelpAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+    connect(actionHelpAbout, SIGNAL(triggered()), SLOT(actionHelpAboutTriggered()));
+
+    connect(buttonSolve, SIGNAL(clicked()), SLOT(buttonSolveClicked()));
+    connect(buttonRandom, SIGNAL(clicked()), SLOT(buttonRandomClicked()));
+    connect(buttonBackToTask, SIGNAL(clicked()), SLOT(buttonBackToTaskClicked()));
+    connect(spinCities, SIGNAL(valueChanged(int)), SLOT(spinCitiesValueChanged(int)));
 
 #ifndef HANDHELD
-	// Centering main window
+    // Centering main window
 QRect rect = geometry();
-	rect.moveCenter(QApplication::desktop()->availableGeometry(this).center());
-	setGeometry(rect);
-	if (settings->value("SavePos", DEF_SAVEPOS).toBool()) {
-		// Loading of saved window state
-		settings->beginGroup("MainWindow");
-		restoreGeometry(settings->value("Geometry").toByteArray());
-		restoreState(settings->value("State").toByteArray());
-		settings->endGroup();
-	}
+    rect.moveCenter(QApplication::desktop()->availableGeometry(this).center());
+    setGeometry(rect);
+    if (settings->value("SavePos", DEF_SAVEPOS).toBool()) {
+        // Loading of saved window state
+        settings->beginGroup("MainWindow");
+        restoreGeometry(settings->value("Geometry").toByteArray());
+        restoreState(settings->value("State").toByteArray());
+        settings->endGroup();
+    }
 #endif // HANDHELD
 
-	tspmodel = new CTSPModel(this);
-	taskView->setModel(tspmodel);
-	connect(tspmodel, SIGNAL(numCitiesChanged(int)), SLOT(numCitiesChanged(int)));
-	connect(tspmodel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(dataChanged(const QModelIndex &, const QModelIndex &)));
-	connect(tspmodel, SIGNAL(layoutChanged()), SLOT(dataChanged()));
-	if ((QCoreApplication::arguments().count() > 1) && (tspmodel->loadTask(QCoreApplication::arguments().at(1))))
-		setFileName(QCoreApplication::arguments().at(1));
-	else {
-		setFileName();
-		spinCities->setValue(settings->value("NumCities",DEF_NUM_CITIES).toInt());
-		spinCitiesValueChanged(spinCities->value());
-	}
-	setWindowModified(false);
-
-	if (actionHelpCheck4Updates != NULL) {
-		if (!settings->contains("Check4Updates/Enabled")) {
-			QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-			settings->setValue("Check4Updates/Enabled",
-				QMessageBox::question(this, QCoreApplication::applicationName(),
-					tr("Would you like %1 to automatically check for updates every %n day(s)?", "", settings->value("Check4Updates/Interval", DEF_UPDATE_CHECK_INTERVAL).toInt()).arg(QCoreApplication::applicationName()),
-					QMessageBox::Yes | QMessageBox::No
-				) == QMessageBox::Yes
-			);
-			QApplication::restoreOverrideCursor();
-		}
-		if ((settings->value("Check4Updates/Enabled", DEF_CHECK_FOR_UPDATES).toBool())
-			&& (QDate(qvariant_cast<QDate>(settings->value("Check4Updates/LastAttempt"))).daysTo(QDate::currentDate()) >= settings->value("Check4Updates/Interval", DEF_UPDATE_CHECK_INTERVAL).toInt())) {
-			check4Updates(true);
-		}
-	}
+    tspmodel = new CTSPModel(this);
+    taskView->setModel(tspmodel);
+    connect(tspmodel, SIGNAL(numCitiesChanged(int)), SLOT(numCitiesChanged(int)));
+    connect(tspmodel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(dataChanged(const QModelIndex &, const QModelIndex &)));
+    connect(tspmodel, SIGNAL(layoutChanged()), SLOT(dataChanged()));
+    if ((QCoreApplication::arguments().count() > 1) && (tspmodel->loadTask(QCoreApplication::arguments().at(1))))
+        setFileName(QCoreApplication::arguments().at(1));
+    else {
+        setFileName();
+        spinCities->setValue(settings->value("NumCities",DEF_NUM_CITIES).toInt());
+        spinCitiesValueChanged(spinCities->value());
+    }
+    setWindowModified(false);
+
+    if (actionHelpCheck4Updates != NULL) {
+        if (!settings->contains("Check4Updates/Enabled")) {
+            QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+            settings->setValue("Check4Updates/Enabled",
+                QMessageBox::question(this, QCoreApplication::applicationName(),
+                    tr("Would you like %1 to automatically check for updates every %n day(s)?", "", settings->value("Check4Updates/Interval", DEF_UPDATE_CHECK_INTERVAL).toInt()).arg(QCoreApplication::applicationName()),
+                    QMessageBox::Yes | QMessageBox::No
+                ) == QMessageBox::Yes
+            );
+            QApplication::restoreOverrideCursor();
+        }
+        if ((settings->value("Check4Updates/Enabled", DEF_CHECK_FOR_UPDATES).toBool())
+            && (QDate(qvariant_cast<QDate>(settings->value("Check4Updates/LastAttempt"))).daysTo(QDate::currentDate()) >= settings->value("Check4Updates/Interval", DEF_UPDATE_CHECK_INTERVAL).toInt())) {
+            check4Updates(true);
+        }
+    }
 }
 
@@ -146,5 +146,5 @@
 {
 #ifndef QT_NO_PRINTER
-	delete printer;
+    delete printer;
 #endif
 }
@@ -154,62 +154,62 @@
 void MainWindow::actionFileNewTriggered()
 {
-	if (!maybeSave())
-		return;
-	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-	tspmodel->clear();
-	setFileName();
-	setWindowModified(false);
-	tabWidget->setCurrentIndex(0);
-	solutionText->clear();
-	toggleSolutionActions(false);
-	QApplication::restoreOverrideCursor();
+    if (!maybeSave())
+        return;
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    tspmodel->clear();
+    setFileName();
+    setWindowModified(false);
+    tabWidget->setCurrentIndex(0);
+    solutionText->clear();
+    toggleSolutionActions(false);
+    QApplication::restoreOverrideCursor();
 }
 
 void MainWindow::actionFileOpenTriggered()
 {
-	if (!maybeSave())
-		return;
+    if (!maybeSave())
+        return;
 
 QStringList filters(tr("All Supported Formats") + " (*.tspt *.zkt)");
-	filters.append(tr("%1 Task Files").arg("TSPSG") + " (*.tspt)");
-	filters.append(tr("%1 Task Files").arg("ZKomModRd") + " (*.zkt)");
-	filters.append(tr("All Files") + " (*)");
+    filters.append(tr("%1 Task Files").arg("TSPSG") + " (*.tspt)");
+    filters.append(tr("%1 Task Files").arg("ZKomModRd") + " (*.zkt)");
+    filters.append(tr("All Files") + " (*)");
 
 QString file;
-	if ((fileName == tr("Untitled") + ".tspt") && settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
-		file = settings->value(OS"/LastUsed/TaskLoadPath").toString();
-	else
-		file = QFileInfo(fileName).path();
+    if ((fileName == tr("Untitled") + ".tspt") && settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
+        file = settings->value(OS"/LastUsed/TaskLoadPath").toString();
+    else
+        file = QFileInfo(fileName).path();
 QFileDialog::Options opts = settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool() ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog;
-	file = QFileDialog::getOpenFileName(this, tr("Task Load"), file, filters.join(";;"), NULL, opts);
-	if (file.isEmpty() || !QFileInfo(file).isFile())
-		return;
-	if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
-		settings->setValue(OS"/LastUsed/TaskLoadPath", QFileInfo(file).path());
-
-	if (!tspmodel->loadTask(file))
-		return;
-	setFileName(file);
-	tabWidget->setCurrentIndex(0);
-	setWindowModified(false);
-	solutionText->clear();
-	toggleSolutionActions(false);
+    file = QFileDialog::getOpenFileName(this, tr("Task Load"), file, filters.join(";;"), NULL, opts);
+    if (file.isEmpty() || !QFileInfo(file).isFile())
+        return;
+    if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
+        settings->setValue(OS"/LastUsed/TaskLoadPath", QFileInfo(file).path());
+
+    if (!tspmodel->loadTask(file))
+        return;
+    setFileName(file);
+    tabWidget->setCurrentIndex(0);
+    setWindowModified(false);
+    solutionText->clear();
+    toggleSolutionActions(false);
 }
 
 bool MainWindow::actionFileSaveTriggered()
 {
-	if ((fileName == tr("Untitled") + ".tspt") || !fileName.endsWith(".tspt", Qt::CaseInsensitive))
-		return saveTask();
-	else
-		if (tspmodel->saveTask(fileName)) {
-			setWindowModified(false);
-			return true;
-		} else
-			return false;
+    if ((fileName == tr("Untitled") + ".tspt") || !fileName.endsWith(".tspt", Qt::CaseInsensitive))
+        return saveTask();
+    else
+        if (tspmodel->saveTask(fileName)) {
+            setWindowModified(false);
+            return true;
+        } else
+            return false;
 }
 
 void MainWindow::actionFileSaveAsTaskTriggered()
 {
-	saveTask();
+    saveTask();
 }
 
@@ -217,126 +217,126 @@
 {
 static QString selectedFile;
-	if (selectedFile.isEmpty()) {
-		if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) {
-			selectedFile = settings->value(OS"/LastUsed/SolutionSavePath").toString();
-		}
-	} else
-		selectedFile = QFileInfo(selectedFile).path();
-	if (!selectedFile.isEmpty())
-		selectedFile.append("/");
-	if (fileName == tr("Untitled") + ".tspt") {
+    if (selectedFile.isEmpty()) {
+        if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) {
+            selectedFile = settings->value(OS"/LastUsed/SolutionSavePath").toString();
+        }
+    } else
+        selectedFile = QFileInfo(selectedFile).path();
+    if (!selectedFile.isEmpty())
+        selectedFile.append("/");
+    if (fileName == tr("Untitled") + ".tspt") {
 #ifndef QT_NO_PRINTER
-		selectedFile += "solution.pdf";
+        selectedFile += "solution.pdf";
 #else
-		selectedFile += "solution.html";
+        selectedFile += "solution.html";
 #endif // QT_NO_PRINTER
-	} else {
+    } else {
 #ifndef QT_NO_PRINTER
-		selectedFile += QFileInfo(fileName).completeBaseName() + ".pdf";
+        selectedFile += QFileInfo(fileName).completeBaseName() + ".pdf";
 #else
-		selectedFile += QFileInfo(fileName).completeBaseName() + ".html";
+        selectedFile += QFileInfo(fileName).completeBaseName() + ".html";
 #endif // QT_NO_PRINTER
-	}
+    }
 
 QStringList filters;
 #ifndef QT_NO_PRINTER
-	filters.append(tr("PDF Files") + " (*.pdf)");
-#endif
-	filters.append(tr("HTML Files") + " (*.html *.htm)");
-	filters.append(tr("OpenDocument Files") + " (*.odt)");
-	filters.append(tr("All Files") + " (*)");
+    filters.append(tr("PDF Files") + " (*.pdf)");
+#endif
+    filters.append(tr("HTML Files") + " (*.html *.htm)");
+    filters.append(tr("OpenDocument Files") + " (*.odt)");
+    filters.append(tr("All Files") + " (*)");
 
 QFileDialog::Options opts(settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool() ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog);
 QString file = QFileDialog::getSaveFileName(this, QString(), selectedFile, filters.join(";;"), NULL, opts);
-	if (file.isEmpty())
-		return;
-	selectedFile = file;
-	if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
-		settings->setValue(OS"/LastUsed/SolutionSavePath", QFileInfo(selectedFile).path());
-	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    if (file.isEmpty())
+        return;
+    selectedFile = file;
+    if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
+        settings->setValue(OS"/LastUsed/SolutionSavePath", QFileInfo(selectedFile).path());
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 #ifndef QT_NO_PRINTER
-	if (selectedFile.endsWith(".pdf",Qt::CaseInsensitive)) {
+    if (selectedFile.endsWith(".pdf",Qt::CaseInsensitive)) {
 QPrinter printer(QPrinter::HighResolution);
-		printer.setOutputFormat(QPrinter::PdfFormat);
-		printer.setOutputFileName(selectedFile);
-		solutionText->document()->print(&printer);
-		QApplication::restoreOverrideCursor();
-		return;
-	}
-#endif
-	if (selectedFile.endsWith(".htm", Qt::CaseInsensitive) || selectedFile.endsWith(".html", Qt::CaseInsensitive)) {
+        printer.setOutputFormat(QPrinter::PdfFormat);
+        printer.setOutputFileName(selectedFile);
+        solutionText->document()->print(&printer);
+        QApplication::restoreOverrideCursor();
+        return;
+    }
+#endif
+    if (selectedFile.endsWith(".htm", Qt::CaseInsensitive) || selectedFile.endsWith(".html", Qt::CaseInsensitive)) {
 QFile file(selectedFile);
-		if (!file.open(QFile::WriteOnly)) {
-			QApplication::restoreOverrideCursor();
-			QMessageBox::critical(this, tr("Solution Save"), tr("Unable to save the solution.\nError: %1").arg(file.errorString()));
-			return;
-		}
+        if (!file.open(QFile::WriteOnly)) {
+            QApplication::restoreOverrideCursor();
+            QMessageBox::critical(this, tr("Solution Save"), tr("Unable to save the solution.\nError: %1").arg(file.errorString()));
+            return;
+        }
 QFileInfo fi(selectedFile);
 QString format = settings->value("Output/GraphImageFormat", DEF_GRAPH_IMAGE_FORMAT).toString();
 #if !defined(NOSVG)
-	if (!QImageWriter::supportedImageFormats().contains(format.toAscii()) && (format != "svg")) {
+    if (!QImageWriter::supportedImageFormats().contains(format.toAscii()) && (format != "svg")) {
 #else // NOSVG
-	if (!QImageWriter::supportedImageFormats().contains(format.toAscii())) {
+    if (!QImageWriter::supportedImageFormats().contains(format.toAscii())) {
 #endif // NOSVG
-		format = DEF_GRAPH_IMAGE_FORMAT;
-		settings->remove("Output/GraphImageFormat");
-	}
+        format = DEF_GRAPH_IMAGE_FORMAT;
+        settings->remove("Output/GraphImageFormat");
+    }
 QString html = solutionText->document()->toHtml("UTF-8"),
-		img =  fi.completeBaseName() + "." + format;
-		html.replace(QRegExp("font-family:([^;]*);"), "font-family:\\1, 'DejaVu Sans Mono', 'Courier New', Courier, monospace;");
-		html.replace(QRegExp("<img\\s+src=\"tspsg://graph.pic\""), QString("<img src=\"%1\" alt=\"%2\"").arg(img, tr("Solution Graph")));
-
-		// Saving solution text as HTML
+        img =  fi.completeBaseName() + "." + format;
+        html.replace(QRegExp("font-family:([^;]*);"), "font-family:\\1, 'DejaVu Sans Mono', 'Courier New', Courier, monospace;");
+        html.replace(QRegExp("<img\\s+src=\"tspsg://graph.pic\""), QString("<img src=\"%1\" alt=\"%2\"").arg(img, tr("Solution Graph")));
+
+        // Saving solution text as HTML
 QTextStream ts(&file);
-		ts.setCodec(QTextCodec::codecForName("UTF-8"));
-		ts << html;
-		file.close();
-
-		// Saving solution graph as SVG or PNG (depending on settings and SVG support)
+        ts.setCodec(QTextCodec::codecForName("UTF-8"));
+        ts << html;
+        file.close();
+
+        // Saving solution graph as SVG or PNG (depending on settings and SVG support)
 #if !defined(NOSVG)
-		if (format == "svg") {
+        if (format == "svg") {
 QSvgGenerator svg;
-			svg.setSize(QSize(graph.width() + 2, graph.height() + 2));
-			svg.setResolution(graph.logicalDpiX());
-			svg.setFileName(fi.path() + "/" + img);
-			svg.setTitle(tr("Solution Graph"));
-			svg.setDescription(tr("Generated with %1").arg(QCoreApplication::applicationName()));
+            svg.setSize(QSize(graph.width() + 2, graph.height() + 2));
+            svg.setResolution(graph.logicalDpiX());
+            svg.setFileName(fi.path() + "/" + img);
+            svg.setTitle(tr("Solution Graph"));
+            svg.setDescription(tr("Generated with %1").arg(QCoreApplication::applicationName()));
 QPainter p;
-			p.begin(&svg);
-			p.drawPicture(1, 1, graph);
-			p.end();
-		} else {
+            p.begin(&svg);
+            p.drawPicture(1, 1, graph);
+            p.end();
+        } else {
 #endif // NOSVG
 QImage i(graph.width() + 2, graph.height() + 2, QImage::Format_ARGB32);
-			i.fill(0x00FFFFFF);
+            i.fill(0x00FFFFFF);
 QPainter p;
-			p.begin(&i);
-			p.drawPicture(1, 1, graph);
-			p.end();
+            p.begin(&i);
+            p.drawPicture(1, 1, graph);
+            p.end();
 QImageWriter pic(fi.path() + "/" + img);
-			if (pic.supportsOption(QImageIOHandler::Description)) {
-				pic.setText("Title", "Solution Graph");
-				pic.setText("Software", QCoreApplication::applicationName());
-			}
-			if (format == "png")
-				pic.setQuality(5);
-			else if (format == "jpeg")
-				pic.setQuality(80);
-			if (!pic.write(i)) {
-				QApplication::restoreOverrideCursor();
-				QMessageBox::critical(this, tr("Solution Save"), tr("Unable to save the solution graph.\nError: %1").arg(pic.errorString()));
-				return;
-			}
+            if (pic.supportsOption(QImageIOHandler::Description)) {
+                pic.setText("Title", "Solution Graph");
+                pic.setText("Software", QCoreApplication::applicationName());
+            }
+            if (format == "png")
+                pic.setQuality(5);
+            else if (format == "jpeg")
+                pic.setQuality(80);
+            if (!pic.write(i)) {
+                QApplication::restoreOverrideCursor();
+                QMessageBox::critical(this, tr("Solution Save"), tr("Unable to save the solution graph.\nError: %1").arg(pic.errorString()));
+                return;
+            }
 #if !defined(NOSVG)
-		}
+        }
 #endif // NOSVG
-	} else {
+    } else {
 QTextDocumentWriter dw(selectedFile);
-		if (!selectedFile.endsWith(".odt",Qt::CaseInsensitive))
-			dw.setFormat("plaintext");
-		if (!dw.write(solutionText->document()))
-			QMessageBox::critical(this, tr("Solution Save"), tr("Unable to save the solution.\nError: %1").arg(dw.device()->errorString()));
-	}
-	QApplication::restoreOverrideCursor();
+        if (!selectedFile.endsWith(".odt",Qt::CaseInsensitive))
+            dw.setFormat("plaintext");
+        if (!dw.write(solutionText->document()))
+            QMessageBox::critical(this, tr("Solution Save"), tr("Unable to save the solution.\nError: %1").arg(dw.device()->errorString()));
+    }
+    QApplication::restoreOverrideCursor();
 }
 
@@ -345,6 +345,6 @@
 {
 QPrintPreviewDialog ppd(printer, this);
-	connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *)));
-	ppd.exec();
+    connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *)));
+    ppd.exec();
 }
 
@@ -352,9 +352,9 @@
 {
 QPrintDialog pd(printer,this);
-	if (pd.exec() != QDialog::Accepted)
-		return;
-	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-	solutionText->print(printer);
-	QApplication::restoreOverrideCursor();
+    if (pd.exec() != QDialog::Accepted)
+        return;
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    solutionText->print(printer);
+    QApplication::restoreOverrideCursor();
 }
 #endif // QT_NO_PRINTER
@@ -363,22 +363,22 @@
 {
 SettingsDialog sd(this);
-	if (sd.exec() != QDialog::Accepted)
-		return;
-	if (sd.colorChanged() || sd.fontChanged()) {
-		if (!solutionText->document()->isEmpty() && sd.colorChanged())
-			QMessageBox::information(this, tr("Settings Changed"), tr("You have changed color settings.\nThey will be applied to the next solution output."));
-		initDocStyleSheet();
-	}
-	if (sd.translucencyChanged() != 0)
-		toggleTranclucency(sd.translucencyChanged() == 1);
+    if (sd.exec() != QDialog::Accepted)
+        return;
+    if (sd.colorChanged() || sd.fontChanged()) {
+        if (!solutionText->document()->isEmpty() && sd.colorChanged())
+            QMessageBox::information(this, tr("Settings Changed"), tr("You have changed color settings.\nThey will be applied to the next solution output."));
+        initDocStyleSheet();
+    }
+    if (sd.translucencyChanged() != 0)
+        toggleTranclucency(sd.translucencyChanged() == 1);
 }
 
 void MainWindow::actionSettingsLanguageAutodetectTriggered(bool checked)
 {
-	if (checked) {
-		settings->remove("Language");
-		QMessageBox::information(this, tr("Language change"), tr("Language will be autodetected on the next %1 start.").arg(QCoreApplication::applicationName()));
-	} else
-		settings->setValue("Language", groupSettingsLanguageList->checkedAction()->data().toString());
+    if (checked) {
+        settings->remove("Language");
+        QMessageBox::information(this, tr("Language change"), tr("Language will be autodetected on the next %1 start.").arg(QCoreApplication::applicationName()));
+    } else
+        settings->setValue("Language", groupSettingsLanguageList->checkedAction()->data().toString());
 }
 
@@ -386,34 +386,34 @@
 {
 #ifndef Q_WS_MAEMO_5
-	if (actionSettingsLanguageAutodetect->isChecked())
-		actionSettingsLanguageAutodetect->trigger();
+    if (actionSettingsLanguageAutodetect->isChecked())
+        actionSettingsLanguageAutodetect->trigger();
 #endif
 bool untitled = (fileName == tr("Untitled") + ".tspt");
-	if (loadLanguage(action->data().toString())) {
-		QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-		settings->setValue("Language",action->data().toString());
-		retranslateUi();
-		if (untitled)
-			setFileName();
-#ifdef Q_WS_WIN32
-		if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
-			toggleStyle(labelVariant, true);
-			toggleStyle(labelCities, true);
-		}
-#endif
-		QApplication::restoreOverrideCursor();
-		if (!solutionText->document()->isEmpty())
-			QMessageBox::information(this, tr("Settings Changed"), tr("You have changed the application language.\nTo get current solution output in the new language\nyou need to re-run the solution process."));
-	}
+    if (loadLanguage(action->data().toString())) {
+        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+        settings->setValue("Language",action->data().toString());
+        retranslateUi();
+        if (untitled)
+            setFileName();
+#ifdef Q_WS_WIN32
+        if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
+            toggleStyle(labelVariant, true);
+            toggleStyle(labelCities, true);
+        }
+#endif
+        QApplication::restoreOverrideCursor();
+        if (!solutionText->document()->isEmpty())
+            QMessageBox::information(this, tr("Settings Changed"), tr("You have changed the application language.\nTo get current solution output in the new language\nyou need to re-run the solution process."));
+    }
 }
 
 void MainWindow::actionSettingsStyleSystemTriggered(bool checked)
 {
-	if (checked) {
-		settings->remove("Style");
-		QMessageBox::information(this, tr("Style Change"), tr("To apply the default style you need to restart %1.").arg(QCoreApplication::applicationName()));
-	} else {
-		settings->setValue("Style", groupSettingsStyleList->checkedAction()->text());
-	}
+    if (checked) {
+        settings->remove("Style");
+        QMessageBox::information(this, tr("Style Change"), tr("To apply the default style you need to restart %1.").arg(QCoreApplication::applicationName()));
+    } else {
+        settings->setValue("Style", groupSettingsStyleList->checkedAction()->text());
+    }
 }
 
@@ -421,9 +421,9 @@
 {
 QStyle *s = QStyleFactory::create(action->text());
-	if (s != NULL) {
-		QApplication::setStyle(s);
-		settings->setValue("Style", action->text());
-		actionSettingsStyleSystem->setChecked(false);
-	}
+    if (s != NULL) {
+        QApplication::setStyle(s);
+        settings->setValue("Style", action->text());
+        actionSettingsStyleSystem->setChecked(false);
+    }
 }
 
@@ -432,14 +432,14 @@
 {
 QtToolBarDialog dlg(this);
-	dlg.setToolBarManager(toolBarManager);
-	dlg.exec();
+    dlg.setToolBarManager(toolBarManager);
+    dlg.exec();
 QToolButton *tb = static_cast<QToolButton *>(toolBarMain->widgetForAction(actionFileSave));
-	if (tb != NULL) {
-		tb->setMenu(menuFileSaveAs);
-		tb->setPopupMode(QToolButton::MenuButtonPopup);
-		tb->resize(tb->sizeHint());
-	}
-
-	loadToolbarList();
+    if (tb != NULL) {
+        tb->setMenu(menuFileSaveAs);
+        tb->setPopupMode(QToolButton::MenuButtonPopup);
+        tb->resize(tb->sizeHint());
+    }
+
+    loadToolbarList();
 }
 #endif // HANDHELD
@@ -447,80 +447,80 @@
 void MainWindow::actionHelpCheck4UpdatesTriggered()
 {
-	if (!hasUpdater()) {
-		QMessageBox::warning(this, tr("Unsupported Feature"), tr("Sorry, but this feature is not supported on your platform\nor support for this feature was not installed."));
-		return;
-	}
-
-	check4Updates();
+    if (!hasUpdater()) {
+        QMessageBox::warning(this, tr("Unsupported Feature"), tr("Sorry, but this feature is not supported on your platform\nor support for this feature was not installed."));
+        return;
+    }
+
+    check4Updates();
 }
 
 void MainWindow::actionHelpAboutTriggered()
 {
-	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 
 QString title;
-	title += QString("<b>%1</b><br>").arg(QCoreApplication::applicationName());
-	title += QString("%1: <b>%2</b><br>").arg(tr("Version"), QCoreApplication::applicationVersion());
+    title += QString("<b>%1</b><br>").arg(QCoreApplication::applicationName());
+    title += QString("%1: <b>%2</b><br>").arg(tr("Version"), QCoreApplication::applicationVersion());
 #ifndef HANDHELD
-	title += QString("<b>&copy; 2007-%1 <a href=\"http://%2/\">%3</a></b><br>").arg(QDate::currentDate().toString("yyyy"), QCoreApplication::organizationDomain(), QCoreApplication::organizationName());
+    title += QString("<b>&copy; 2007-%1 <a href=\"http://%2/\">%3</a></b><br>").arg(QDate::currentDate().toString("yyyy"), QCoreApplication::organizationDomain(), QCoreApplication::organizationName());
 #endif // HANDHELD
-	title += QString("<b><a href=\"http://tspsg.info/\">http://tspsg.info/</a></b>");
+    title += QString("<b><a href=\"http://tspsg.info/\">http://tspsg.info/</a></b>");
 
 QString about;
-	about += QString("%1: <b>%2</b><br>").arg(tr("Target OS (ARCH)"), PLATFROM);
+    about += QString("%1: <b>%2</b><br>").arg(tr("Target OS (ARCH)"), PLATFROM);
 #ifndef STATIC_BUILD
-	about += QString("%1 (%2):<br>").arg(tr("Qt library"), tr("shared"));
-	about += QString("&nbsp;&nbsp;&nbsp;&nbsp;%1: <b>%2</b><br>").arg(tr("Build time"), QT_VERSION_STR);
-	about += QString("&nbsp;&nbsp;&nbsp;&nbsp;%1: <b>%2</b><br>").arg(tr("Runtime"), qVersion());
+    about += QString("%1 (%2):<br>").arg(tr("Qt library"), tr("shared"));
+    about += QString("&nbsp;&nbsp;&nbsp;&nbsp;%1: <b>%2</b><br>").arg(tr("Build time"), QT_VERSION_STR);
+    about += QString("&nbsp;&nbsp;&nbsp;&nbsp;%1: <b>%2</b><br>").arg(tr("Runtime"), qVersion());
 #else
-	about += QString("%1: <b>%2</b> (%3)<br>").arg(tr("Qt library"), QT_VERSION_STR, tr("static"));
+    about += QString("%1: <b>%2</b> (%3)<br>").arg(tr("Qt library"), QT_VERSION_STR, tr("static"));
 #endif // STATIC_BUILD
-	about += tr("Buid <b>%1</b>, built on <b>%2</b> at <b>%3</b> with <b>%4</b> compiler.").arg(BUILD_NUMBER).arg(__DATE__).arg(__TIME__).arg(COMPILER) + "<br>";
-	about += QString("%1: <b>%2</b><br>").arg(tr("Algorithm"), CTSPSolver::getVersionId());
-	about += "<br>";
-	about += tr("This program is free software: you can redistribute it and/or modify<br>\n"
-		"it under the terms of the GNU General Public License as published by<br>\n"
-		"the Free Software Foundation, either version 3 of the License, or<br>\n"
-		"(at your option) any later version.<br>\n"
-		"<br>\n"
-		"This program is distributed in the hope that it will be useful,<br>\n"
-		"but WITHOUT ANY WARRANTY; without even the implied warranty of<br>\n"
-		"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>\n"
-		"GNU General Public License for more details.<br>\n"
-		"<br>\n"
-		"You should have received a copy of the GNU General Public License<br>\n"
-		"along with TSPSG.  If not, see <a href=\"http://www.gnu.org/licenses/\">www.gnu.org/licenses/</a>.");
+    about += tr("Buid <b>%1</b>, built on <b>%2</b> at <b>%3</b> with <b>%4</b> compiler.").arg(BUILD_NUMBER).arg(__DATE__).arg(__TIME__).arg(COMPILER) + "<br>";
+    about += QString("%1: <b>%2</b><br>").arg(tr("Algorithm"), CTSPSolver::getVersionId());
+    about += "<br>";
+    about += tr("This program is free software: you can redistribute it and/or modify<br>\n"
+        "it under the terms of the GNU General Public License as published by<br>\n"
+        "the Free Software Foundation, either version 3 of the License, or<br>\n"
+        "(at your option) any later version.<br>\n"
+        "<br>\n"
+        "This program is distributed in the hope that it will be useful,<br>\n"
+        "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>\n"
+        "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>\n"
+        "GNU General Public License for more details.<br>\n"
+        "<br>\n"
+        "You should have received a copy of the GNU General Public License<br>\n"
+        "along with TSPSG.  If not, see <a href=\"http://www.gnu.org/licenses/\">www.gnu.org/licenses/</a>.");
 
 QString credits;
-	credits += tr("%1 was created using <b>Qt&nbsp;framework</b> licensed "
-		"under the terms of the GNU Lesser General Public License,<br>\n"
-		"see <a href=\"http://qt.nokia.com/\">qt.nokia.com</a><br>\n"
-		"<br>\n"
-		"Most icons used in %1 are part of <b>Oxygen&nbsp;Icons</b> project "
-		"licensed according to the GNU Lesser General Public License,<br>\n"
-		"see <a href=\"http://www.oxygen-icons.org/\">www.oxygen-icons.org</a><br>\n"
-		"<br>\n"
-		"Country flag icons used in %1 are part of the free "
-		"<b>Flag&nbsp;Icons</b> collection created by <b>IconDrawer</b>,<br>\n"
-		"see <a href=\"http://www.icondrawer.com/\">www.icondrawer.com</a><br>\n"
-		"<br>\n"
-		"%1 comes with the default \"embedded\" font <b>DejaVu&nbsp;LGC&nbsp;Sans&nbsp;"
-		"Mono</b> from the <b>DejaVu fonts</b> licensed under a Free license</a>,<br>\n"
-		"see <a href=\"http://dejavu-fonts.org/\">dejavu-fonts.org</a>")
-			.arg("TSPSG");
+    credits += tr("%1 was created using <b>Qt&nbsp;framework</b> licensed "
+        "under the terms of the GNU Lesser General Public License,<br>\n"
+        "see <a href=\"http://qt.nokia.com/\">qt.nokia.com</a><br>\n"
+        "<br>\n"
+        "Most icons used in %1 are part of <b>Oxygen&nbsp;Icons</b> project "
+        "licensed according to the GNU Lesser General Public License,<br>\n"
+        "see <a href=\"http://www.oxygen-icons.org/\">www.oxygen-icons.org</a><br>\n"
+        "<br>\n"
+        "Country flag icons used in %1 are part of the free "
+        "<b>Flag&nbsp;Icons</b> collection created by <b>IconDrawer</b>,<br>\n"
+        "see <a href=\"http://www.icondrawer.com/\">www.icondrawer.com</a><br>\n"
+        "<br>\n"
+        "%1 comes with the default \"embedded\" font <b>DejaVu&nbsp;LGC&nbsp;Sans&nbsp;"
+        "Mono</b> from the <b>DejaVu fonts</b> licensed under a Free license</a>,<br>\n"
+        "see <a href=\"http://dejavu-fonts.org/\">dejavu-fonts.org</a>")
+            .arg("TSPSG");
 
 QFile f(":/files/COPYING");
-	f.open(QIODevice::ReadOnly);
+    f.open(QIODevice::ReadOnly);
 
 QString translation = QCoreApplication::translate("--------", "AUTHORS %1", "Please, provide translator credits here. %1 will be replaced with VERSION");
-	if ((translation != "AUTHORS %1") && (translation.contains("%1"))) {
+    if ((translation != "AUTHORS %1") && (translation.contains("%1"))) {
 QString about = QCoreApplication::translate("--------", "VERSION", "Please, provide your translation version here.");
-		if (about != "VERSION")
-			translation = translation.arg(about);
-	}
+        if (about != "VERSION")
+            translation = translation.arg(about);
+    }
 
 QDialog *dlg = new QDialog(this);
 QLabel *lblIcon = new QLabel(dlg),
-	*lblTitle = new QLabel(dlg);
+    *lblTitle = new QLabel(dlg);
 #ifdef HANDHELD
 QLabel *lblSubTitle = new QLabel(QString("<b>&copy; 2007-%1 <a href=\"http://%2/\">%3</a></b>").arg(QDate::currentDate().toString("yyyy"), QCoreApplication::organizationDomain(), QCoreApplication::organizationName()), dlg);
@@ -532,107 +532,107 @@
 QVBoxLayout *vb = new QVBoxLayout();
 QHBoxLayout *hb1 = new QHBoxLayout(),
-	*hb2 = new QHBoxLayout();
+    *hb2 = new QHBoxLayout();
 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, dlg);
 
-	lblTitle->setOpenExternalLinks(true);
-	lblTitle->setText(title);
-	lblTitle->setAlignment(Qt::AlignTop);
-	lblTitle->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+    lblTitle->setOpenExternalLinks(true);
+    lblTitle->setText(title);
+    lblTitle->setAlignment(Qt::AlignTop);
+    lblTitle->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
 #ifndef HANDHELD
-	lblTitle->setStyleSheet(QString("QLabel {background-color: %1; border-color: %2; border-width: 1px; border-style: solid; border-radius: 4px; padding: 1px;}").arg(palette().alternateBase().color().name(), palette().shadow().color().name()));
+    lblTitle->setStyleSheet(QString("QLabel {background-color: %1; border-color: %2; border-width: 1px; border-style: solid; border-radius: 4px; padding: 1px;}").arg(palette().alternateBase().color().name(), palette().shadow().color().name()));
 #endif // HANDHELD
 
-	lblIcon->setPixmap(QPixmap(":/images/tspsg.png").scaledToHeight(lblTitle->sizeHint().height(), Qt::SmoothTransformation));
-	lblIcon->setAlignment(Qt::AlignVCenter);
+    lblIcon->setPixmap(QPixmap(":/images/tspsg.png").scaledToHeight(lblTitle->sizeHint().height(), Qt::SmoothTransformation));
+    lblIcon->setAlignment(Qt::AlignVCenter);
 #ifndef HANDHELD
-	lblIcon->setStyleSheet(QString("QLabel {background-color: white; border-color: %1; border-width: 1px; border-style: solid; border-radius: 4px; padding: 1px;}").arg(palette().windowText().color().name()));
+    lblIcon->setStyleSheet(QString("QLabel {background-color: white; border-color: %1; border-width: 1px; border-style: solid; border-radius: 4px; padding: 1px;}").arg(palette().windowText().color().name()));
 #endif // HANDHELD
 
-	hb1->addWidget(lblIcon);
-	hb1->addWidget(lblTitle);
-
-	txtAbout->setWordWrapMode(QTextOption::NoWrap);
-	txtAbout->setOpenExternalLinks(true);
-	txtAbout->setHtml(about);
-	txtAbout->moveCursor(QTextCursor::Start);
-	txtAbout->setFrameShape(QFrame::NoFrame);
+    hb1->addWidget(lblIcon);
+    hb1->addWidget(lblTitle);
+
+    txtAbout->setWordWrapMode(QTextOption::NoWrap);
+    txtAbout->setOpenExternalLinks(true);
+    txtAbout->setHtml(about);
+    txtAbout->moveCursor(QTextCursor::Start);
+    txtAbout->setFrameShape(QFrame::NoFrame);
 
 //	txtCredits->setWordWrapMode(QTextOption::NoWrap);
-	txtCredits->setOpenExternalLinks(true);
-	txtCredits->setHtml(credits);
-	txtCredits->moveCursor(QTextCursor::Start);
-	txtCredits->setFrameShape(QFrame::NoFrame);
-
-	txtLicense->setWordWrapMode(QTextOption::NoWrap);
-	txtLicense->setOpenExternalLinks(true);
-	txtLicense->setText(f.readAll());
-	txtLicense->moveCursor(QTextCursor::Start);
-	txtLicense->setFrameShape(QFrame::NoFrame);
-
-	bb->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor));
-	bb->button(QDialogButtonBox::Ok)->setIcon(GET_ICON("dialog-ok"));
-
-	hb2->addWidget(bb);
+    txtCredits->setOpenExternalLinks(true);
+    txtCredits->setHtml(credits);
+    txtCredits->moveCursor(QTextCursor::Start);
+    txtCredits->setFrameShape(QFrame::NoFrame);
+
+    txtLicense->setWordWrapMode(QTextOption::NoWrap);
+    txtLicense->setOpenExternalLinks(true);
+    txtLicense->setText(f.readAll());
+    txtLicense->moveCursor(QTextCursor::Start);
+    txtLicense->setFrameShape(QFrame::NoFrame);
+
+    bb->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor));
+    bb->button(QDialogButtonBox::Ok)->setIcon(GET_ICON("dialog-ok"));
+
+    hb2->addWidget(bb);
 
 #ifdef Q_WS_WINCE_WM
-	vb->setMargin(3);
+    vb->setMargin(3);
 #endif // Q_WS_WINCE_WM
-	vb->addLayout(hb1);
+    vb->addLayout(hb1);
 #ifdef HANDHELD
-	vb->addWidget(lblSubTitle);
+    vb->addWidget(lblSubTitle);
 #endif // HANDHELD
 
-	tabs->addTab(txtAbout, tr("About"));
-	tabs->addTab(txtLicense, tr("License"));
-	tabs->addTab(txtCredits, tr("Credits"));
-	if (translation != "AUTHORS %1") {
+    tabs->addTab(txtAbout, tr("About"));
+    tabs->addTab(txtLicense, tr("License"));
+    tabs->addTab(txtCredits, tr("Credits"));
+    if (translation != "AUTHORS %1") {
 QTextBrowser *txtTranslation = new QTextBrowser(dlg);
 //		txtTranslation->setWordWrapMode(QTextOption::NoWrap);
-		txtTranslation->setOpenExternalLinks(true);
-		txtTranslation->setText(translation);
-		txtTranslation->moveCursor(QTextCursor::Start);
-		txtTranslation->setFrameShape(QFrame::NoFrame);
-
-		tabs->addTab(txtTranslation, tr("Translation"));
-	}
+        txtTranslation->setOpenExternalLinks(true);
+        txtTranslation->setText(translation);
+        txtTranslation->moveCursor(QTextCursor::Start);
+        txtTranslation->setFrameShape(QFrame::NoFrame);
+
+        tabs->addTab(txtTranslation, tr("Translation"));
+    }
 #ifndef HANDHELD
-	tabs->setStyleSheet(QString("QTabWidget::pane {background-color: %1; border-color: %3; border-width: 1px; border-style: solid; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; padding: 1px;} QTabBar::tab {background-color: %2; border-color: %3; border-width: 1px; border-style: solid; border-bottom: none; border-top-left-radius: 4px; border-top-right-radius: 4px; padding: 2px 6px;} QTabBar::tab:selected {background-color: %4;} QTabBar::tab:!selected {margin-top: 1px;}").arg(palette().base().color().name(), palette().button().color().name(), palette().shadow().color().name(), palette().light().color().name()));
+    tabs->setStyleSheet(QString("QTabWidget::pane {background-color: %1; border-color: %3; border-width: 1px; border-style: solid; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; padding: 1px;} QTabBar::tab {background-color: %2; border-color: %3; border-width: 1px; border-style: solid; border-bottom: none; border-top-left-radius: 4px; border-top-right-radius: 4px; padding: 2px 6px;} QTabBar::tab:selected {background-color: %4;} QTabBar::tab:!selected {margin-top: 1px;}").arg(palette().base().color().name(), palette().button().color().name(), palette().shadow().color().name(), palette().light().color().name()));
 #endif // HANDHELD
 
-	vb->addWidget(tabs);
-	vb->addLayout(hb2);
-
-	dlg->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
-	dlg->setWindowTitle(tr("About %1").arg(QCoreApplication::applicationName()));
-	dlg->setWindowIcon(GET_ICON("help-about"));
-	dlg->setLayout(vb);
-
-	connect(bb, SIGNAL(accepted()), dlg, SLOT(accept()));
-
-#ifdef Q_WS_WIN32
-	// Adding some eyecandy in Vista and 7 :-)
-	if (QtWin::isCompositionEnabled())  {
-		QtWin::enableBlurBehindWindow(dlg, true);
-	}
+    vb->addWidget(tabs);
+    vb->addLayout(hb2);
+
+    dlg->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
+    dlg->setWindowTitle(tr("About %1").arg(QCoreApplication::applicationName()));
+    dlg->setWindowIcon(GET_ICON("help-about"));
+    dlg->setLayout(vb);
+
+    connect(bb, SIGNAL(accepted()), dlg, SLOT(accept()));
+
+#ifdef Q_WS_WIN32
+    // Adding some eyecandy in Vista and 7 :-)
+    if (QtWin::isCompositionEnabled())  {
+        QtWin::enableBlurBehindWindow(dlg, true);
+    }
 #endif // Q_WS_WIN32
 
-	dlg->resize(450, 350);
-	QApplication::restoreOverrideCursor();
-
-	dlg->exec();
-
-	delete dlg;
+    dlg->resize(450, 350);
+    QApplication::restoreOverrideCursor();
+
+    dlg->exec();
+
+    delete dlg;
 }
 
 void MainWindow::buttonBackToTaskClicked()
 {
-	tabWidget->setCurrentIndex(0);
+    tabWidget->setCurrentIndex(0);
 }
 
 void MainWindow::buttonRandomClicked()
 {
-	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-	tspmodel->randomize();
-	QApplication::restoreOverrideCursor();
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    tspmodel->randomize();
+    QApplication::restoreOverrideCursor();
 }
 
@@ -643,337 +643,337 @@
 int n = spinCities->value();
 bool ok;
-	for (int r = 0; r < n; r++) {
-		row.clear();
-		for (int c = 0; c < n; c++) {
-			row.append(tspmodel->index(r,c).data(Qt::UserRole).toDouble(&ok));
-			if (!ok) {
-				QMessageBox::critical(this, tr("Data error"), tr("Error in cell [Row %1; Column %2]: Invalid data format.").arg(r + 1).arg(c + 1));
-				return;
-			}
-		}
-		matrix.append(row);
-	}
+    for (int r = 0; r < n; r++) {
+        row.clear();
+        for (int c = 0; c < n; c++) {
+            row.append(tspmodel->index(r,c).data(Qt::UserRole).toDouble(&ok));
+            if (!ok) {
+                QMessageBox::critical(this, tr("Data error"), tr("Error in cell [Row %1; Column %2]: Invalid data format.").arg(r + 1).arg(c + 1));
+                return;
+            }
+        }
+        matrix.append(row);
+    }
 
 QProgressDialog pd(this);
 QProgressBar *pb = new QProgressBar(&pd);
-	pb->setAlignment(Qt::AlignCenter);
-	pb->setFormat(tr("%v of %1 parts found").arg(n));
-	pd.setBar(pb);
+    pb->setAlignment(Qt::AlignCenter);
+    pb->setFormat(tr("%v of %1 parts found").arg(n));
+    pd.setBar(pb);
 QPushButton *cancel = new QPushButton(&pd);
-	cancel->setIcon(GET_ICON("dialog-cancel"));
-	cancel->setText(QCoreApplication::translate("QProgressDialog", "Cancel", "No need to translate this. This translation will be taken from Qt translation files."));
-	pd.setCancelButton(cancel);
-	pd.setMaximum(n);
-	pd.setAutoReset(false);
-	pd.setLabelText(tr("Calculating optimal route..."));
-	pd.setWindowTitle(tr("Solution Progress"));
-	pd.setWindowModality(Qt::ApplicationModal);
-	pd.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
-	pd.show();
+    cancel->setIcon(GET_ICON("dialog-cancel"));
+    cancel->setText(QCoreApplication::translate("QProgressDialog", "Cancel", "No need to translate this. This translation will be taken from Qt translation files."));
+    pd.setCancelButton(cancel);
+    pd.setMaximum(n);
+    pd.setAutoReset(false);
+    pd.setLabelText(tr("Calculating optimal route..."));
+    pd.setWindowTitle(tr("Solution Progress"));
+    pd.setWindowModality(Qt::ApplicationModal);
+    pd.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
+    pd.show();
 
 #ifdef Q_WS_WIN32
 HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (LPVOID*)&tl);
-	if (SUCCEEDED(hr)) {
-		hr = tl->HrInit();
-		if (FAILED(hr)) {
-			tl->Release();
-			tl = NULL;
-		} else {
+    if (SUCCEEDED(hr)) {
+        hr = tl->HrInit();
+        if (FAILED(hr)) {
+            tl->Release();
+            tl = NULL;
+        } else {
 //			tl->SetProgressState(winId(), TBPF_INDETERMINATE);
-			tl->SetProgressValue(winId(), 0, n * 2);
-		}
-	}
+            tl->SetProgressValue(winId(), 0, n * 2);
+        }
+    }
 #endif
 
 CTSPSolver solver;
-	solver.setCleanupOnCancel(false);
-	connect(&solver, SIGNAL(routePartFound(int)), &pd, SLOT(setValue(int)));
-	connect(&pd, SIGNAL(canceled()), &solver, SLOT(cancel()));
-#ifdef Q_WS_WIN32
-	if (tl != NULL)
-		connect(&solver, SIGNAL(routePartFound(int)), SLOT(solverRoutePartFound(int)));
+    solver.setCleanupOnCancel(false);
+    connect(&solver, SIGNAL(routePartFound(int)), &pd, SLOT(setValue(int)));
+    connect(&pd, SIGNAL(canceled()), &solver, SLOT(cancel()));
+#ifdef Q_WS_WIN32
+    if (tl != NULL)
+        connect(&solver, SIGNAL(routePartFound(int)), SLOT(solverRoutePartFound(int)));
 #endif
 SStep *root = solver.solve(n, matrix);
 #ifdef Q_WS_WIN32
-	if (tl != NULL)
-		disconnect(&solver, SIGNAL(routePartFound(int)), this, SLOT(solverRoutePartFound(int)));
-#endif
-	disconnect(&solver, SIGNAL(routePartFound(int)), &pd, SLOT(setValue(int)));
-	disconnect(&pd, SIGNAL(canceled()), &solver, SLOT(cancel()));
-	if (!root) {
-		pd.reset();
-		if (!solver.wasCanceled()) {
-#ifdef Q_WS_WIN32
-			if (tl != NULL) {
+    if (tl != NULL)
+        disconnect(&solver, SIGNAL(routePartFound(int)), this, SLOT(solverRoutePartFound(int)));
+#endif
+    disconnect(&solver, SIGNAL(routePartFound(int)), &pd, SLOT(setValue(int)));
+    disconnect(&pd, SIGNAL(canceled()), &solver, SLOT(cancel()));
+    if (!root) {
+        pd.reset();
+        if (!solver.wasCanceled()) {
+#ifdef Q_WS_WIN32
+            if (tl != NULL) {
 //				tl->SetProgressValue(winId(), n, n * 2);
-				tl->SetProgressState(winId(), TBPF_ERROR);
-			}
-#endif
-			QApplication::alert(this);
-			QMessageBox::warning(this, tr("Solution Result"), tr("Unable to find a solution.\nMaybe, this task has no solution."));
-		}
-		pd.setLabelText(tr("Cleaning up..."));
-		pd.setMaximum(0);
-		pd.setCancelButton(NULL);
-		pd.show();
-#ifdef Q_WS_WIN32
-		if (tl != NULL)
-			tl->SetProgressState(winId(), TBPF_INDETERMINATE);
-#endif
-		QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+                tl->SetProgressState(winId(), TBPF_ERROR);
+            }
+#endif
+            QApplication::alert(this);
+            QMessageBox::warning(this, tr("Solution Result"), tr("Unable to find a solution.\nMaybe, this task has no solution."));
+        }
+        pd.setLabelText(tr("Cleaning up..."));
+        pd.setMaximum(0);
+        pd.setCancelButton(NULL);
+        pd.show();
+#ifdef Q_WS_WIN32
+        if (tl != NULL)
+            tl->SetProgressState(winId(), TBPF_INDETERMINATE);
+#endif
+        QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
 
 #ifndef QT_NO_CONCURRENT
 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
-		while (!f.isFinished()) {
-			QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-		}
+        while (!f.isFinished()) {
+            QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+        }
 #else
-		solver.cleanup(true);
-#endif
-		pd.reset();
-#ifdef Q_WS_WIN32
-		if (tl != NULL) {
-			tl->SetProgressState(winId(), TBPF_NOPROGRESS);
-			tl->Release();
-			tl = NULL;
-		}
-#endif
-		return;
-	}
-	pb->setFormat(tr("Generating header"));
-	pd.setLabelText(tr("Generating solution output..."));
-	pd.setMaximum(solver.getTotalSteps() + 1);
-	pd.setValue(0);
-
-#ifdef Q_WS_WIN32
-	if (tl != NULL)
-		tl->SetProgressValue(winId(), spinCities->value(), spinCities->value() + solver.getTotalSteps() + 1);
-#endif
-
-	solutionText->clear();
-	solutionText->setDocumentTitle(tr("Solution of Variant #%1 Task").arg(spinVariant->value()));
+        solver.cleanup(true);
+#endif
+        pd.reset();
+#ifdef Q_WS_WIN32
+        if (tl != NULL) {
+            tl->SetProgressState(winId(), TBPF_NOPROGRESS);
+            tl->Release();
+            tl = NULL;
+        }
+#endif
+        return;
+    }
+    pb->setFormat(tr("Generating header"));
+    pd.setLabelText(tr("Generating solution output..."));
+    pd.setMaximum(solver.getTotalSteps() + 1);
+    pd.setValue(0);
+
+#ifdef Q_WS_WIN32
+    if (tl != NULL)
+        tl->SetProgressValue(winId(), spinCities->value(), spinCities->value() + solver.getTotalSteps() + 1);
+#endif
+
+    solutionText->clear();
+    solutionText->setDocumentTitle(tr("Solution of Variant #%1 Task").arg(spinVariant->value()));
 
 QPainter pic;
-	if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
-		pic.begin(&graph);
-		pic.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
+    if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
+        pic.begin(&graph);
+        pic.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
 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);
-			font.setPointSizeF(font.pointSizeF() * 2);
-		}
-		pic.setFont(font);
-		pic.setBrush(QBrush(QColor(Qt::white)));
-		if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) {
+        if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) {
+            font.setWeight(QFont::DemiBold);
+            font.setPointSizeF(font.pointSizeF() * 2);
+        }
+        pic.setFont(font);
+        pic.setBrush(QBrush(QColor(Qt::white)));
+        if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) {
 QPen pen = pic.pen();
-			pen.setWidth(2);
-			pic.setPen(pen);
-		}
-		pic.setBackgroundMode(Qt::OpaqueMode);
-	}
+            pen.setWidth(2);
+            pic.setPen(pen);
+        }
+        pic.setBackgroundMode(Qt::OpaqueMode);
+    }
 
 QTextDocument *doc = solutionText->document();
 QTextCursor cur(doc);
 
-	cur.beginEditBlock();
-	cur.setBlockFormat(fmt_paragraph);
-	cur.insertText(tr("Variant #%1 Task").arg(spinVariant->value()), fmt_default);
-	cur.insertBlock(fmt_paragraph);
-	cur.insertText(tr("Task:"));
-	outputMatrix(cur, matrix);
-	if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
+    cur.beginEditBlock();
+    cur.setBlockFormat(fmt_paragraph);
+    cur.insertText(tr("Variant #%1 Task").arg(spinVariant->value()), fmt_default);
+    cur.insertBlock(fmt_paragraph);
+    cur.insertText(tr("Task:"));
+    outputMatrix(cur, matrix);
+    if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
 #ifdef _T_T_L_
-		_b_ _i_ _z_ _a_ _r_ _r_ _e_
-#endif
-		drawNode(pic, 0);
-	}
-	cur.insertHtml("<hr>");
-	cur.insertBlock(fmt_paragraph);
+        _b_ _i_ _z_ _a_ _r_ _r_ _e_
+#endif
+        drawNode(pic, 0);
+    }
+    cur.insertHtml("<hr>");
+    cur.insertBlock(fmt_paragraph);
 int imgpos = cur.position();
-	cur.insertText(tr("Variant #%1 Solution").arg(spinVariant->value()), fmt_default);
-	cur.endEditBlock();
+    cur.insertText(tr("Variant #%1 Solution").arg(spinVariant->value()), fmt_default);
+    cur.endEditBlock();
 
 SStep *step = root;
 int c = n = 1;
-	pb->setFormat(tr("Generating step %v"));
-	while ((step->next != SStep::NoNextStep) && (c < spinCities->value())) {
-		if (pd.wasCanceled()) {
-			pd.setLabelText(tr("Cleaning up..."));
-			pd.setMaximum(0);
-			pd.setCancelButton(NULL);
-			pd.show();
-			QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-#ifdef Q_WS_WIN32
-			if (tl != NULL)
-				tl->SetProgressState(winId(), TBPF_INDETERMINATE);
+    pb->setFormat(tr("Generating step %v"));
+    while ((step->next != SStep::NoNextStep) && (c < spinCities->value())) {
+        if (pd.wasCanceled()) {
+            pd.setLabelText(tr("Cleaning up..."));
+            pd.setMaximum(0);
+            pd.setCancelButton(NULL);
+            pd.show();
+            QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+#ifdef Q_WS_WIN32
+            if (tl != NULL)
+                tl->SetProgressState(winId(), TBPF_INDETERMINATE);
 #endif
 #ifndef QT_NO_CONCURRENT
 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
-			while (!f.isFinished()) {
-				QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-			}
+            while (!f.isFinished()) {
+                QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+            }
 #else
-			solver.cleanup(true);
-#endif
-			solutionText->clear();
-			toggleSolutionActions(false);
-#ifdef Q_WS_WIN32
-			if (tl != NULL) {
-				tl->SetProgressState(winId(), TBPF_NOPROGRESS);
-				tl->Release();
-				tl = NULL;
-			}
-#endif
-			return;
-		}
-		pd.setValue(n);
-#ifdef Q_WS_WIN32
-		if (tl != NULL)
-			tl->SetProgressValue(winId(), spinCities->value() + n, spinCities->value() + solver.getTotalSteps() + 1);
-#endif
-
-		cur.beginEditBlock();
-		cur.insertBlock(fmt_paragraph);
-		cur.insertText(tr("Step #%1").arg(n));
-		if (settings->value("Output/ShowMatrix", DEF_SHOW_MATRIX).toBool() && (!settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() || (settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() && (spinCities->value() <= settings->value("Output/ShowMatrixLimit", DEF_SHOW_MATRIX_LIMIT).toInt())))) {
-			outputMatrix(cur, *step);
-		}
-		cur.insertBlock(fmt_paragraph);
-		cur.insertText(tr("Selected route %1 %2 part.").arg((step->next == SStep::RightBranch) ? tr("with") : tr("without")).arg(tr("(%1;%2)").arg(step->candidate.nRow + 1).arg(step->candidate.nCol + 1)), fmt_default);
-		if (!step->alts.empty()) {
-			SStep::SCandidate cand;
-			QString alts;
-			foreach(cand, step->alts) {
-				if (!alts.isEmpty())
-					alts += ", ";
-				alts += tr("(%1;%2)").arg(cand.nRow + 1).arg(cand.nCol + 1);
-			}
-			cur.insertBlock(fmt_paragraph);
-			cur.insertText(tr("%n alternate candidate(s) for branching: %1.", "", step->alts.count()).arg(alts), fmt_altlist);
-		}
-		cur.insertBlock(fmt_paragraph);
-		cur.insertText(" ", fmt_default);
-		cur.endEditBlock();
-
-		if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
-			if (step->prNode != NULL)
-				drawNode(pic, n, false, step->prNode);
-			if (step->plNode != NULL)
-				drawNode(pic, n, true, step->plNode);
-		}
-		n++;
-
-		if (step->next == SStep::RightBranch) {
-			c++;
-			step = step->prNode;
-		} else if (step->next == SStep::LeftBranch) {
-			step = step->plNode;
-		} else
-			break;
-	}
-	pb->setFormat(tr("Generating footer"));
-	pd.setValue(n);
-#ifdef Q_WS_WIN32
-	if (tl != NULL)
-		tl->SetProgressValue(winId(), spinCities->value() + n, spinCities->value() + solver.getTotalSteps() + 1);
-#endif
-
-	cur.beginEditBlock();
-	cur.insertBlock(fmt_paragraph);
-	if (solver.isOptimal())
-		cur.insertText(tr("Optimal path:"));
-	else
-		cur.insertText(tr("Resulting path:"));
-
-	cur.insertBlock(fmt_paragraph);
-	cur.insertText("  " + solver.getSortedPath(tr("City %1")));
-
-	cur.insertBlock(fmt_paragraph);
-	if (isInteger(step->price))
-		cur.insertHtml("<p>" + tr("The price is <b>%n</b> unit(s).", "", qRound(step->price)) + "</p>");
-	else
-		cur.insertHtml("<p>" + tr("The price is <b>%1</b> units.").arg(step->price, 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()) + "</p>");
-	if (!solver.isOptimal()) {
-		cur.insertBlock(fmt_paragraph);
-		cur.insertText(" ");
-		cur.insertBlock(fmt_paragraph);
-		cur.insertHtml("<p>" + tr("<b>WARNING!!!</b><br>This result is a record, but it may not be optimal.<br>Iterations need to be continued to check whether this result is optimal or get an optimal one.") + "</p>");
-	}
-	cur.endEditBlock();
-
-	if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
-		pic.end();
+            solver.cleanup(true);
+#endif
+            solutionText->clear();
+            toggleSolutionActions(false);
+#ifdef Q_WS_WIN32
+            if (tl != NULL) {
+                tl->SetProgressState(winId(), TBPF_NOPROGRESS);
+                tl->Release();
+                tl = NULL;
+            }
+#endif
+            return;
+        }
+        pd.setValue(n);
+#ifdef Q_WS_WIN32
+        if (tl != NULL)
+            tl->SetProgressValue(winId(), spinCities->value() + n, spinCities->value() + solver.getTotalSteps() + 1);
+#endif
+
+        cur.beginEditBlock();
+        cur.insertBlock(fmt_paragraph);
+        cur.insertText(tr("Step #%1").arg(n));
+        if (settings->value("Output/ShowMatrix", DEF_SHOW_MATRIX).toBool() && (!settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() || (settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() && (spinCities->value() <= settings->value("Output/ShowMatrixLimit", DEF_SHOW_MATRIX_LIMIT).toInt())))) {
+            outputMatrix(cur, *step);
+        }
+        cur.insertBlock(fmt_paragraph);
+        cur.insertText(tr("Selected route %1 %2 part.").arg((step->next == SStep::RightBranch) ? tr("with") : tr("without")).arg(tr("(%1;%2)").arg(step->candidate.nRow + 1).arg(step->candidate.nCol + 1)), fmt_default);
+        if (!step->alts.empty()) {
+            SStep::SCandidate cand;
+            QString alts;
+            foreach(cand, step->alts) {
+                if (!alts.isEmpty())
+                    alts += ", ";
+                alts += tr("(%1;%2)").arg(cand.nRow + 1).arg(cand.nCol + 1);
+            }
+            cur.insertBlock(fmt_paragraph);
+            cur.insertText(tr("%n alternate candidate(s) for branching: %1.", "", step->alts.count()).arg(alts), fmt_altlist);
+        }
+        cur.insertBlock(fmt_paragraph);
+        cur.insertText(" ", fmt_default);
+        cur.endEditBlock();
+
+        if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
+            if (step->prNode != NULL)
+                drawNode(pic, n, false, step->prNode);
+            if (step->plNode != NULL)
+                drawNode(pic, n, true, step->plNode);
+        }
+        n++;
+
+        if (step->next == SStep::RightBranch) {
+            c++;
+            step = step->prNode;
+        } else if (step->next == SStep::LeftBranch) {
+            step = step->plNode;
+        } else
+            break;
+    }
+    pb->setFormat(tr("Generating footer"));
+    pd.setValue(n);
+#ifdef Q_WS_WIN32
+    if (tl != NULL)
+        tl->SetProgressValue(winId(), spinCities->value() + n, spinCities->value() + solver.getTotalSteps() + 1);
+#endif
+
+    cur.beginEditBlock();
+    cur.insertBlock(fmt_paragraph);
+    if (solver.isOptimal())
+        cur.insertText(tr("Optimal path:"));
+    else
+        cur.insertText(tr("Resulting path:"));
+
+    cur.insertBlock(fmt_paragraph);
+    cur.insertText("  " + solver.getSortedPath(tr("City %1")));
+
+    cur.insertBlock(fmt_paragraph);
+    if (isInteger(step->price))
+        cur.insertHtml("<p>" + tr("The price is <b>%n</b> unit(s).", "", qRound(step->price)) + "</p>");
+    else
+        cur.insertHtml("<p>" + tr("The price is <b>%1</b> units.").arg(step->price, 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()) + "</p>");
+    if (!solver.isOptimal()) {
+        cur.insertBlock(fmt_paragraph);
+        cur.insertText(" ");
+        cur.insertBlock(fmt_paragraph);
+        cur.insertHtml("<p>" + tr("<b>WARNING!!!</b><br>This result is a record, but it may not be optimal.<br>Iterations need to be continued to check whether this result is optimal or get an optimal one.") + "</p>");
+    }
+    cur.endEditBlock();
+
+    if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
+        pic.end();
 
 QImage i(graph.width() + 2, graph.height() + 2, QImage::Format_RGB32);
-		i.fill(0xFFFFFF);
-		pic.begin(&i);
-		pic.drawPicture(1, 1, graph);
-		pic.end();
-		doc->addResource(QTextDocument::ImageResource, QUrl("tspsg://graph.pic"), i);
+        i.fill(0xFFFFFF);
+        pic.begin(&i);
+        pic.drawPicture(1, 1, graph);
+        pic.end();
+        doc->addResource(QTextDocument::ImageResource, QUrl("tspsg://graph.pic"), i);
 
 QTextImageFormat img;
-		img.setName("tspsg://graph.pic");
-		if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) {
-			img.setWidth(i.width() / 2);
-			img.setHeight(i.height() / 2);
-		} else {
-			img.setWidth(i.width());
-			img.setHeight(i.height());
-		}
-
-		cur.setPosition(imgpos);
-		cur.insertImage(img, QTextFrameFormat::FloatRight);
-	}
-
-	if (settings->value("Output/ScrollToEnd", DEF_SCROLL_TO_END).toBool()) {
-		// Scrolling to the end of the text.
-		solutionText->moveCursor(QTextCursor::End);
-	} else
-		solutionText->moveCursor(QTextCursor::Start);
-
-	pd.setLabelText(tr("Cleaning up..."));
-	pd.setMaximum(0);
-	pd.setCancelButton(NULL);
-	QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-#ifdef Q_WS_WIN32
-	if (tl != NULL)
-		tl->SetProgressState(winId(), TBPF_INDETERMINATE);
+        img.setName("tspsg://graph.pic");
+        if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) {
+            img.setWidth(i.width() / 2);
+            img.setHeight(i.height() / 2);
+        } else {
+            img.setWidth(i.width());
+            img.setHeight(i.height());
+        }
+
+        cur.setPosition(imgpos);
+        cur.insertImage(img, QTextFrameFormat::FloatRight);
+    }
+
+    if (settings->value("Output/ScrollToEnd", DEF_SCROLL_TO_END).toBool()) {
+        // Scrolling to the end of the text.
+        solutionText->moveCursor(QTextCursor::End);
+    } else
+        solutionText->moveCursor(QTextCursor::Start);
+
+    pd.setLabelText(tr("Cleaning up..."));
+    pd.setMaximum(0);
+    pd.setCancelButton(NULL);
+    QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+#ifdef Q_WS_WIN32
+    if (tl != NULL)
+        tl->SetProgressState(winId(), TBPF_INDETERMINATE);
 #endif
 #ifndef QT_NO_CONCURRENT
 QFuture<void> f = QtConcurrent::run(&solver, &CTSPSolver::cleanup, false);
-	while (!f.isFinished()) {
-		QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-	}
+    while (!f.isFinished()) {
+        QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+    }
 #else
-	solver.cleanup(true);
-#endif
-	toggleSolutionActions();
-	tabWidget->setCurrentIndex(1);
-#ifdef Q_WS_WIN32
-	if (tl != NULL) {
-		tl->SetProgressState(winId(), TBPF_NOPROGRESS);
-		tl->Release();
-		tl = NULL;
-	}
-#endif
-
-	pd.reset();
-	QApplication::alert(this, 3000);
+    solver.cleanup(true);
+#endif
+    toggleSolutionActions();
+    tabWidget->setCurrentIndex(1);
+#ifdef Q_WS_WIN32
+    if (tl != NULL) {
+        tl->SetProgressState(winId(), TBPF_NOPROGRESS);
+        tl->Release();
+        tl = NULL;
+    }
+#endif
+
+    pd.reset();
+    QApplication::alert(this, 3000);
 }
 
 void MainWindow::dataChanged()
 {
-	setWindowModified(true);
+    setWindowModified(true);
 }
 
 void MainWindow::dataChanged(const QModelIndex &tl, const QModelIndex &br)
 {
-	setWindowModified(true);
-	if (settings->value("Autosize", DEF_AUTOSIZE).toBool()) {
-		for (int k = tl.row(); k <= br.row(); k++)
-			taskView->resizeRowToContents(k);
-		for (int k = tl.column(); k <= br.column(); k++)
-			taskView->resizeColumnToContents(k);
-	}
+    setWindowModified(true);
+    if (settings->value("Autosize", DEF_AUTOSIZE).toBool()) {
+        for (int k = tl.row(); k <= br.row(); k++)
+            taskView->resizeRowToContents(k);
+        for (int k = tl.column(); k <= br.column(); k++)
+            taskView->resizeColumnToContents(k);
+    }
 }
 
@@ -981,33 +981,33 @@
 void MainWindow::changeEvent(QEvent *ev)
 {
-	if ((ev->type() == QEvent::ActivationChange) && isActiveWindow())
-		desktopResized(0);
-
-	QWidget::changeEvent(ev);
+    if ((ev->type() == QEvent::ActivationChange) && isActiveWindow())
+        desktopResized(0);
+
+    QWidget::changeEvent(ev);
 }
 
 void MainWindow::desktopResized(int screen)
 {
-	if ((screen != 0) || !isActiveWindow())
-		return;
+    if ((screen != 0) || !isActiveWindow())
+        return;
 
 QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
-	if (currentGeometry != availableGeometry) {
-		QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-		/*!
-		 * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
-		 *  If \c true, the window gets maximized. If we used \c setGeometry() in this case, the bottom of the
-		 *  window would end up being behind the soft buttons. Is this a bug in Qt or Windows Mobile?
-		 */
-		if ((availableGeometry.top() + availableGeometry.height()) == QApplication::desktop()->screenGeometry().height()) {
-			setWindowState(windowState() | Qt::WindowMaximized);
-		} else {
-			if (windowState() & Qt::WindowMaximized)
-				setWindowState(windowState() ^ Qt::WindowMaximized);
-			setGeometry(availableGeometry);
-		}
-		currentGeometry = availableGeometry;
-		QApplication::restoreOverrideCursor();
-	}
+    if (currentGeometry != availableGeometry) {
+        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+        /*!
+         * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
+         *  If \c true, the window gets maximized. If we used \c setGeometry() in this case, the bottom of the
+         *  window would end up being behind the soft buttons. Is this a bug in Qt or Windows Mobile?
+         */
+        if ((availableGeometry.top() + availableGeometry.height()) == QApplication::desktop()->screenGeometry().height()) {
+            setWindowState(windowState() | Qt::WindowMaximized);
+        } else {
+            if (windowState() & Qt::WindowMaximized)
+                setWindowState(windowState() ^ Qt::WindowMaximized);
+            setGeometry(availableGeometry);
+        }
+        currentGeometry = availableGeometry;
+        QApplication::restoreOverrideCursor();
+    }
 }
 #endif // Q_WS_WINCE_WM
@@ -1015,7 +1015,7 @@
 void MainWindow::numCitiesChanged(int nCities)
 {
-	blockSignals(true);
-	spinCities->setValue(nCities);
-	blockSignals(false);
+    blockSignals(true);
+    spinCities->setValue(nCities);
+    blockSignals(false);
 }
 
@@ -1023,5 +1023,5 @@
 void MainWindow::printPreview(QPrinter *printer)
 {
-	solutionText->print(printer);
+    solutionText->print(printer);
 }
 #endif // QT_NO_PRINTER
@@ -1031,7 +1031,7 @@
 {
 #ifdef Q_WS_WIN32
-	tl->SetProgressValue(winId(), n, spinCities->value() * 2);
+    tl->SetProgressValue(winId(), n, spinCities->value() * 2);
 #else
-	Q_UNUSED(n);
+    Q_UNUSED(n);
 #endif // Q_WS_WIN32
 }
@@ -1040,13 +1040,13 @@
 void MainWindow::spinCitiesValueChanged(int n)
 {
-	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 int count = tspmodel->numCities();
-	tspmodel->setNumCities(n);
-	if ((n > count) && settings->value("Autosize", DEF_AUTOSIZE).toBool())
-		for (int k = count; k < n; k++) {
-			taskView->resizeColumnToContents(k);
-			taskView->resizeRowToContents(k);
-		}
-	QApplication::restoreOverrideCursor();
+    tspmodel->setNumCities(n);
+    if ((n > count) && settings->value("Autosize", DEF_AUTOSIZE).toBool())
+        for (int k = count; k < n; k++) {
+            taskView->resizeColumnToContents(k);
+            taskView->resizeRowToContents(k);
+        }
+    QApplication::restoreOverrideCursor();
 }
 
@@ -1054,52 +1054,52 @@
 {
 #ifdef Q_WS_WIN32
-	if (silent)
-		QProcess::startDetached("updater/Update.exe -name=\"TSPSG: TSP Solver and Generator\" -check=\"freeupdate\" -silentcheck");
-	else {
-		QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-		QProcess::execute("updater/Update.exe -name=\"TSPSG: TSP Solver and Generator\" -check=\"freeupdate\"");
-		QApplication::restoreOverrideCursor();
-	}
+    if (silent)
+        QProcess::startDetached("updater/Update.exe -name=\"TSPSG: TSP Solver and Generator\" -check=\"freeupdate\" -silentcheck");
+    else {
+        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+        QProcess::execute("updater/Update.exe -name=\"TSPSG: TSP Solver and Generator\" -check=\"freeupdate\"");
+        QApplication::restoreOverrideCursor();
+    }
 #else
-	Q_UNUSED(silent)
-#endif
-	settings->setValue("Check4Updates/LastAttempt", QDate::currentDate().toString(Qt::ISODate));
+    Q_UNUSED(silent)
+#endif
+    settings->setValue("Check4Updates/LastAttempt", QDate::currentDate().toString(Qt::ISODate));
 }
 
 void MainWindow::closeEvent(QCloseEvent *ev)
 {
-	if (!maybeSave()) {
-		ev->ignore();
-		return;
-	}
-	if (!settings->value("SettingsReset", false).toBool()) {
-		settings->setValue("NumCities", spinCities->value());
-
-		// Saving Main Window state
+    if (!maybeSave()) {
+        ev->ignore();
+        return;
+    }
+    if (!settings->value("SettingsReset", false).toBool()) {
+        settings->setValue("NumCities", spinCities->value());
+
+        // Saving Main Window state
 #ifndef HANDHELD
-		if (settings->value("SavePos", DEF_SAVEPOS).toBool()) {
-			settings->beginGroup("MainWindow");
-			settings->setValue("Geometry", saveGeometry());
-			settings->setValue("State", saveState());
-			settings->setValue("Toolbars", toolBarManager->saveState());
-			settings->endGroup();
-		}
+        if (settings->value("SavePos", DEF_SAVEPOS).toBool()) {
+            settings->beginGroup("MainWindow");
+            settings->setValue("Geometry", saveGeometry());
+            settings->setValue("State", saveState());
+            settings->setValue("Toolbars", toolBarManager->saveState());
+            settings->endGroup();
+        }
 #else
-		settings->setValue("MainWindow/ToolbarVisible", toolBarMain->isVisible());
+        settings->setValue("MainWindow/ToolbarVisible", toolBarMain->isVisible());
 #endif // HANDHELD
-	} else {
-		settings->remove("SettingsReset");
-	}
-
-	QMainWindow::closeEvent(ev);
+    } else {
+        settings->remove("SettingsReset");
+    }
+
+    QMainWindow::closeEvent(ev);
 }
 
 void MainWindow::dragEnterEvent(QDragEnterEvent *ev)
 {
-	if (ev->mimeData()->hasUrls() && (ev->mimeData()->urls().count() == 1)) {
+    if (ev->mimeData()->hasUrls() && (ev->mimeData()->urls().count() == 1)) {
 QFileInfo fi(ev->mimeData()->urls().first().toLocalFile());
-		if ((fi.suffix() == "tspt") || (fi.suffix() == "zkt"))
-			ev->acceptProposedAction();
-	}
+        if ((fi.suffix() == "tspt") || (fi.suffix() == "zkt"))
+            ev->acceptProposedAction();
+    }
 }
 
@@ -1107,50 +1107,50 @@
 {
 int r;
-	if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool())
-		r = 70;
-	else
-		r = 35;
+    if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool())
+        r = 70;
+    else
+        r = 35;
 qreal x, y;
-	if (step != NULL)
-		x = left ? r : r * 3.5;
-	else
-		x = r * 2.25;
-	y = r * (3 * nstep + 1);
+    if (step != NULL)
+        x = left ? r : r * 3.5;
+    else
+        x = r * 2.25;
+    y = r * (3 * nstep + 1);
 
 #ifdef _T_T_L_
-	if (nstep == -481124) {
-		_t_t_l_(pic, r, x);
-		return;
-	}
-#endif
-
-	pic.drawEllipse(QPointF(x, y), r, r);
-
-	if (step != NULL) {
+    if (nstep == -481124) {
+        _t_t_l_(pic, r, x);
+        return;
+    }
+#endif
+
+    pic.drawEllipse(QPointF(x, y), r, r);
+
+    if (step != NULL) {
 QFont font;
-		if (left) {
-			font = pic.font();
-			font.setStrikeOut(true);
-			pic.setFont(font);
-		}
-		pic.drawText(QRectF(x - r, y - r, r * 2, r * 2), Qt::AlignCenter, tr("(%1;%2)").arg(step->pNode->candidate.nRow + 1).arg(step->pNode->candidate.nCol + 1) + "\n");
-		if (left) {
-			font.setStrikeOut(false);
-			pic.setFont(font);
-		}
-		if (step->price != INFINITY) {
-			pic.drawText(QRectF(x - r, y - r, r * 2, r * 2), Qt::AlignCenter, isInteger(step->price) ?  QString("\n%1").arg(step->price) : QString("\n%1").arg(step->price, 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()));
-		} else {
-			pic.drawText(QRectF(x - r, y - r, r * 2, r * 2), Qt::AlignCenter, "\n"INFSTR);
-		}
-	} else {
-		pic.drawText(QRectF(x - r, y - r, r * 2, r * 2), Qt::AlignCenter, tr("Root"));
-	}
-
-	if (nstep == 1) {
-		pic.drawLine(QPointF(x, y - r), QPointF(r * 2.25, y - 2 * r));
-	} else if (nstep > 1) {
-		pic.drawLine(QPointF(x, y - r), QPointF((step->pNode->pNode->next == SStep::RightBranch) ? r * 3.5 : r, y - 2 * r));
-	}
+        if (left) {
+            font = pic.font();
+            font.setStrikeOut(true);
+            pic.setFont(font);
+        }
+        pic.drawText(QRectF(x - r, y - r, r * 2, r * 2), Qt::AlignCenter, tr("(%1;%2)").arg(step->pNode->candidate.nRow + 1).arg(step->pNode->candidate.nCol + 1) + "\n");
+        if (left) {
+            font.setStrikeOut(false);
+            pic.setFont(font);
+        }
+        if (step->price != INFINITY) {
+            pic.drawText(QRectF(x - r, y - r, r * 2, r * 2), Qt::AlignCenter, isInteger(step->price) ?  QString("\n%1").arg(step->price) : QString("\n%1").arg(step->price, 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()));
+        } else {
+            pic.drawText(QRectF(x - r, y - r, r * 2, r * 2), Qt::AlignCenter, "\n"INFSTR);
+        }
+    } else {
+        pic.drawText(QRectF(x - r, y - r, r * 2, r * 2), Qt::AlignCenter, tr("Root"));
+    }
+
+    if (nstep == 1) {
+        pic.drawLine(QPointF(x, y - r), QPointF(r * 2.25, y - 2 * r));
+    } else if (nstep > 1) {
+        pic.drawLine(QPointF(x, y - r), QPointF((step->pNode->pNode->next == SStep::RightBranch) ? r * 3.5 : r, y - 2 * r));
+    }
 
 }
@@ -1158,57 +1158,57 @@
 void MainWindow::dropEvent(QDropEvent *ev)
 {
-	if (maybeSave() && tspmodel->loadTask(ev->mimeData()->urls().first().toLocalFile())) {
-		setFileName(ev->mimeData()->urls().first().toLocalFile());
-		tabWidget->setCurrentIndex(0);
-		setWindowModified(false);
-		solutionText->clear();
-		toggleSolutionActions(false);
-
-		ev->setDropAction(Qt::CopyAction);
-		ev->accept();
-	}
+    if (maybeSave() && tspmodel->loadTask(ev->mimeData()->urls().first().toLocalFile())) {
+        setFileName(ev->mimeData()->urls().first().toLocalFile());
+        tabWidget->setCurrentIndex(0);
+        setWindowModified(false);
+        solutionText->clear();
+        toggleSolutionActions(false);
+
+        ev->setDropAction(Qt::CopyAction);
+        ev->accept();
+    }
 }
 
 void MainWindow::initDocStyleSheet()
 {
-	solutionText->document()->setDefaultFont(qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE))));
-
-	fmt_paragraph.setTopMargin(0);
-	fmt_paragraph.setRightMargin(10);
-	fmt_paragraph.setBottomMargin(0);
-	fmt_paragraph.setLeftMargin(10);
-
-	fmt_table.setTopMargin(5);
-	fmt_table.setRightMargin(10);
-	fmt_table.setBottomMargin(5);
-	fmt_table.setLeftMargin(10);
-	fmt_table.setBorder(0);
-	fmt_table.setBorderStyle(QTextFrameFormat::BorderStyle_None);
-	fmt_table.setCellSpacing(5);
-
-	fmt_cell.setAlignment(Qt::AlignHCenter);
-
-	settings->beginGroup("Output/Colors");
+    solutionText->document()->setDefaultFont(qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE))));
+
+    fmt_paragraph.setTopMargin(0);
+    fmt_paragraph.setRightMargin(10);
+    fmt_paragraph.setBottomMargin(0);
+    fmt_paragraph.setLeftMargin(10);
+
+    fmt_table.setTopMargin(5);
+    fmt_table.setRightMargin(10);
+    fmt_table.setBottomMargin(5);
+    fmt_table.setLeftMargin(10);
+    fmt_table.setBorder(0);
+    fmt_table.setBorderStyle(QTextFrameFormat::BorderStyle_None);
+    fmt_table.setCellSpacing(5);
+
+    fmt_cell.setAlignment(Qt::AlignHCenter);
+
+    settings->beginGroup("Output/Colors");
 
 QColor color = qvariant_cast<QColor>(settings->value("Text", DEF_TEXT_COLOR));
 QColor hilight;
-	if (color.value() < 192)
-		hilight.setHsv(color.hue(), color.saturation(), 127 + qRound(color.value() / 2));
-	else
-		hilight.setHsv(color.hue(), color.saturation(), color.value() / 2);
-
-	solutionText->document()->setDefaultStyleSheet(QString("* {color: %1;}").arg(color.name()));
-	fmt_default.setForeground(QBrush(color));
-
-	fmt_selected.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Selected", DEF_SELECTED_COLOR))));
-	fmt_selected.setFontWeight(QFont::Bold);
-
-	fmt_alternate.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Alternate", DEF_ALTERNATE_COLOR))));
-	fmt_alternate.setFontWeight(QFont::Bold);
-	fmt_altlist.setForeground(QBrush(hilight));
-
-	settings->endGroup();
-
-	solutionText->setTextColor(color);
+    if (color.value() < 192)
+        hilight.setHsv(color.hue(), color.saturation(), 127 + qRound(color.value() / 2));
+    else
+        hilight.setHsv(color.hue(), color.saturation(), color.value() / 2);
+
+    solutionText->document()->setDefaultStyleSheet(QString("* {color: %1;}").arg(color.name()));
+    fmt_default.setForeground(QBrush(color));
+
+    fmt_selected.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Selected", DEF_SELECTED_COLOR))));
+    fmt_selected.setFontWeight(QFont::Bold);
+
+    fmt_alternate.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Alternate", DEF_ALTERNATE_COLOR))));
+    fmt_alternate.setFontWeight(QFont::Bold);
+    fmt_altlist.setForeground(QBrush(hilight));
+
+    settings->endGroup();
+
+    solutionText->setTextColor(color);
 }
 
@@ -1221,46 +1221,46 @@
 QTranslator t;
 QDir dir;
-	dir.setFilter(QDir::Files);
-	dir.setNameFilters(QStringList("tspsg_*.qm"));
-	dir.setSorting(QDir::NoSort);
-
-	dirs << PATH_L10N << ":/l10n";
-	foreach (QString dirname, dirs) {
-		dir.setPath(dirname);
-		if (dir.exists()) {
-			langs = dir.entryInfoList();
-			for (int k = 0; k < langs.size(); k++) {
-				lang = langs.at(k);
-				if (lang.completeBaseName().compare("tspsg_en", Qt::CaseInsensitive) && !langlist.contains(lang.completeBaseName().mid(6)) && t.load(lang.completeBaseName(), dirname)) {
-
-					language.clear();
-					language.append(lang.completeBaseName().mid(6));
-					language.append(t.translate("--------", "COUNTRY", "Please, provide an ISO 3166-1 alpha-2 country code for this translation language here (eg., UA).").toLower());
-					language.append(t.translate("--------", "LANGNAME", "Please, provide a native name of your translation language here."));
-					language.append(t.translate("MainWindow", "Set application language to %1", "").arg(language.at(2)));
-
-					langlist.insert(language.at(0), language);
-				}
-			}
-		}
-	}
+    dir.setFilter(QDir::Files);
+    dir.setNameFilters(QStringList("tspsg_*.qm"));
+    dir.setSorting(QDir::NoSort);
+
+    dirs << PATH_L10N << ":/l10n";
+    foreach (QString dirname, dirs) {
+        dir.setPath(dirname);
+        if (dir.exists()) {
+            langs = dir.entryInfoList();
+            for (int k = 0; k < langs.size(); k++) {
+                lang = langs.at(k);
+                if (lang.completeBaseName().compare("tspsg_en", Qt::CaseInsensitive) && !langlist.contains(lang.completeBaseName().mid(6)) && t.load(lang.completeBaseName(), dirname)) {
+
+                    language.clear();
+                    language.append(lang.completeBaseName().mid(6));
+                    language.append(t.translate("--------", "COUNTRY", "Please, provide an ISO 3166-1 alpha-2 country code for this translation language here (eg., UA).").toLower());
+                    language.append(t.translate("--------", "LANGNAME", "Please, provide a native name of your translation language here."));
+                    language.append(t.translate("MainWindow", "Set application language to %1", "").arg(language.at(2)));
+
+                    langlist.insert(language.at(0), language);
+                }
+            }
+        }
+    }
 
 QAction *a;
-	foreach (language, langlist) {
-		a = menuSettingsLanguage->addAction(language.at(2));
+    foreach (language, langlist) {
+        a = menuSettingsLanguage->addAction(language.at(2));
 #ifndef QT_NO_STATUSTIP
-		a->setStatusTip(language.at(3));
+        a->setStatusTip(language.at(3));
 #endif
 #if QT_VERSION >= 0x040600
-		a->setIcon(QIcon::fromTheme(QString("flag-%1").arg(language.at(1)), QIcon(QString(":/images/icons/l10n/flag-%1.png").arg(language.at(1)))));
+        a->setIcon(QIcon::fromTheme(QString("flag-%1").arg(language.at(1)), QIcon(QString(":/images/icons/l10n/flag-%1.png").arg(language.at(1)))));
 #else
-		a->setIcon(QIcon(QString(":/images/icons/l10n/flag-%1.png").arg(language.at(1))));
-#endif
-		a->setData(language.at(0));
-		a->setCheckable(true);
-		a->setActionGroup(groupSettingsLanguageList);
-		if (settings->value("Language", QLocale::system().name()).toString().startsWith(language.at(0)))
-			a->setChecked(true);
-	}
+        a->setIcon(QIcon(QString(":/images/icons/l10n/flag-%1.png").arg(language.at(1))));
+#endif
+        a->setData(language.at(0));
+        a->setCheckable(true);
+        a->setActionGroup(groupSettingsLanguageList);
+        if (settings->value("Language", QLocale::system().name()).toString().startsWith(language.at(0)))
+            a->setChecked(true);
+    }
 }
 
@@ -1270,103 +1270,103 @@
 bool ad = false;
 QString lng = lang;
-	if (lng.isEmpty()) {
-		ad = settings->value("Language").toString().isEmpty();
-		lng = settings->value("Language", QLocale::system().name()).toString();
-	}
+    if (lng.isEmpty()) {
+        ad = settings->value("Language").toString().isEmpty();
+        lng = settings->value("Language", QLocale::system().name()).toString();
+    }
 static QTranslator *qtTranslator; // Qt library translator
-	if (qtTranslator) {
-		qApp->removeTranslator(qtTranslator);
-		delete qtTranslator;
-		qtTranslator = NULL;
-	}
+    if (qtTranslator) {
+        qApp->removeTranslator(qtTranslator);
+        delete qtTranslator;
+        qtTranslator = NULL;
+    }
 static QTranslator *translator; // Application translator
-	if (translator) {
-		qApp->removeTranslator(translator);
-		delete translator;
-		translator = NULL;
-	}
-
-	if (lng == "en")
-		return true;
-
-	// Trying to load system Qt library translation...
-	qtTranslator = new QTranslator(this);
-	if (qtTranslator->load("qt_" + lng, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
-		qApp->installTranslator(qtTranslator);
-	else {
-		// No luck. Let's try to load a bundled one.
-		if (qtTranslator->load("qt_" + lng, PATH_L10N)) {
-			// We have a translation in the localization direcotry.
-			qApp->installTranslator(qtTranslator);
-		} else if (qtTranslator->load("qt_" + lng, ":/l10n")) {
-			// We have a translation "built-in" into application resources.
-			qApp->installTranslator(qtTranslator);
-		} else {
-			// Qt library translation unavailable for this language.
-			delete qtTranslator;
-			qtTranslator = NULL;
-		}
-	}
-
-	// Now let's load application translation.
-	translator = new QTranslator(this);
-	if (translator->load("tspsg_" + lng, PATH_L10N)) {
-		// We have a translation in the localization directory.
-		qApp->installTranslator(translator);
-	} else if (translator->load("tspsg_" + lng, ":/l10n")) {
-		// We have a translation "built-in" into application resources.
-		qApp->installTranslator(translator);
-	} else {
-		delete translator;
-		translator = NULL;
-		if (!ad) {
-			settings->remove("Language");
-			QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-			QMessageBox::warning(isVisible() ? this : NULL, tr("Language Change"), tr("Unable to load the translation language.\nFalling back to autodetection."));
-			QApplication::restoreOverrideCursor();
-		}
-		return false;
-	}
-	return true;
+    if (translator) {
+        qApp->removeTranslator(translator);
+        delete translator;
+        translator = NULL;
+    }
+
+    if (lng == "en")
+        return true;
+
+    // Trying to load system Qt library translation...
+    qtTranslator = new QTranslator(this);
+    if (qtTranslator->load("qt_" + lng, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+        qApp->installTranslator(qtTranslator);
+    else {
+        // No luck. Let's try to load a bundled one.
+        if (qtTranslator->load("qt_" + lng, PATH_L10N)) {
+            // We have a translation in the localization direcotry.
+            qApp->installTranslator(qtTranslator);
+        } else if (qtTranslator->load("qt_" + lng, ":/l10n")) {
+            // We have a translation "built-in" into application resources.
+            qApp->installTranslator(qtTranslator);
+        } else {
+            // Qt library translation unavailable for this language.
+            delete qtTranslator;
+            qtTranslator = NULL;
+        }
+    }
+
+    // Now let's load application translation.
+    translator = new QTranslator(this);
+    if (translator->load("tspsg_" + lng, PATH_L10N)) {
+        // We have a translation in the localization directory.
+        qApp->installTranslator(translator);
+    } else if (translator->load("tspsg_" + lng, ":/l10n")) {
+        // We have a translation "built-in" into application resources.
+        qApp->installTranslator(translator);
+    } else {
+        delete translator;
+        translator = NULL;
+        if (!ad) {
+            settings->remove("Language");
+            QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+            QMessageBox::warning(isVisible() ? this : NULL, tr("Language Change"), tr("Unable to load the translation language.\nFalling back to autodetection."));
+            QApplication::restoreOverrideCursor();
+        }
+        return false;
+    }
+    return true;
 }
 
 void MainWindow::loadStyleList()
 {
-	menuSettingsStyle->clear();
+    menuSettingsStyle->clear();
 QStringList styles = QStyleFactory::keys();
-	menuSettingsStyle->insertAction(NULL, actionSettingsStyleSystem);
-	actionSettingsStyleSystem->setChecked(!settings->contains("Style"));
-	menuSettingsStyle->addSeparator();
+    menuSettingsStyle->insertAction(NULL, actionSettingsStyleSystem);
+    actionSettingsStyleSystem->setChecked(!settings->contains("Style"));
+    menuSettingsStyle->addSeparator();
 QAction *a;
-	foreach (QString style, styles) {
-		a = menuSettingsStyle->addAction(style);
-		a->setData(false);
+    foreach (QString style, styles) {
+        a = menuSettingsStyle->addAction(style);
+        a->setData(false);
 #ifndef QT_NO_STATUSTIP
-		a->setStatusTip(tr("Set application style to %1").arg(style));
-#endif
-		a->setCheckable(true);
-		a->setActionGroup(groupSettingsStyleList);
-		if ((style == settings->value("Stlye").toString())
+        a->setStatusTip(tr("Set application style to %1").arg(style));
+#endif
+        a->setCheckable(true);
+        a->setActionGroup(groupSettingsStyleList);
+        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);
-		}
-	}
+            || QString(QApplication::style()->metaObject()->className()).contains(QRegExp(QString("^Q?%1(Style)?$").arg(QRegExp::escape(style)), Qt::CaseInsensitive))
+#endif
+        ) {
+            a->setChecked(true);
+        }
+    }
 }
 
 void MainWindow::loadToolbarList()
 {
-	menuSettingsToolbars->clear();
+    menuSettingsToolbars->clear();
 #ifndef HANDHELD
-	menuSettingsToolbars->insertAction(NULL, actionSettingsToolbarsConfigure);
-	menuSettingsToolbars->addSeparator();
+    menuSettingsToolbars->insertAction(NULL, actionSettingsToolbarsConfigure);
+    menuSettingsToolbars->addSeparator();
 QList<QToolBar *> list = toolBarManager->toolBars();
-	foreach (QToolBar *t, list) {
-		menuSettingsToolbars->insertAction(NULL, t->toggleViewAction());
-	}
+    foreach (QToolBar *t, list) {
+        menuSettingsToolbars->insertAction(NULL, t->toggleViewAction());
+    }
 #else // HANDHELD
-	menuSettingsToolbars->insertAction(NULL, toolBarMain->toggleViewAction());
+    menuSettingsToolbars->insertAction(NULL, toolBarMain->toggleViewAction());
 #endif // HANDHELD
 }
@@ -1374,13 +1374,13 @@
 bool MainWindow::maybeSave()
 {
-	if (!isWindowModified())
-		return true;
+    if (!isWindowModified())
+        return true;
 int res = QMessageBox::warning(this, tr("Unsaved Changes"), tr("Would you like to save changes in the current task?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
-	if (res == QMessageBox::Save)
-		return actionFileSaveTriggered();
-	else if (res == QMessageBox::Cancel)
-		return false;
-	else
-		return true;
+    if (res == QMessageBox::Save)
+        return actionFileSaveTriggered();
+    else if (res == QMessageBox::Cancel)
+        return false;
+    else
+        return true;
 }
 
@@ -1390,17 +1390,17 @@
 QTextTable *table = cur.insertTable(n, n, fmt_table);
 
-	for (int r = 0; r < n; r++) {
-		for (int c = 0; c < n; c++) {
-			cur = table->cellAt(r, c).firstCursorPosition();
-			cur.setBlockFormat(fmt_cell);
-			cur.setBlockCharFormat(fmt_default);
-			if (matrix.at(r).at(c) == INFINITY)
-				cur.insertText(INFSTR);
-			else
-				cur.insertText(isInteger(matrix.at(r).at(c)) ? QString("%1").arg(matrix.at(r).at(c)) : QString("%1").arg(matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()));
-		}
-		QCoreApplication::processEvents();
-	}
-	cur.movePosition(QTextCursor::End);
+    for (int r = 0; r < n; r++) {
+        for (int c = 0; c < n; c++) {
+            cur = table->cellAt(r, c).firstCursorPosition();
+            cur.setBlockFormat(fmt_cell);
+            cur.setBlockCharFormat(fmt_default);
+            if (matrix.at(r).at(c) == INFINITY)
+                cur.insertText(INFSTR);
+            else
+                cur.insertText(isInteger(matrix.at(r).at(c)) ? QString("%1").arg(matrix.at(r).at(c)) : QString("%1").arg(matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()));
+        }
+        QCoreApplication::processEvents();
+    }
+    cur.movePosition(QTextCursor::End);
 }
 
@@ -1410,74 +1410,74 @@
 QTextTable *table = cur.insertTable(n, n, fmt_table);
 
-	for (int r = 0; r < n; r++) {
-		for (int c = 0; c < n; c++) {
-			cur = table->cellAt(r, c).firstCursorPosition();
-			cur.setBlockFormat(fmt_cell);
-			if (step.matrix.at(r).at(c) == INFINITY)
-				cur.insertText(INFSTR, fmt_default);
-			else if ((r == step.candidate.nRow) && (c == step.candidate.nCol))
-				cur.insertText(isInteger(step.matrix.at(r).at(c)) ? QString("%1").arg(step.matrix.at(r).at(c)) : QString("%1").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()), fmt_selected);
-			else {
+    for (int r = 0; r < n; r++) {
+        for (int c = 0; c < n; c++) {
+            cur = table->cellAt(r, c).firstCursorPosition();
+            cur.setBlockFormat(fmt_cell);
+            if (step.matrix.at(r).at(c) == INFINITY)
+                cur.insertText(INFSTR, fmt_default);
+            else if ((r == step.candidate.nRow) && (c == step.candidate.nCol))
+                cur.insertText(isInteger(step.matrix.at(r).at(c)) ? QString("%1").arg(step.matrix.at(r).at(c)) : QString("%1").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()), fmt_selected);
+            else {
 SStep::SCandidate cand;
-				cand.nRow = r;
-				cand.nCol = c;
-				if (step.alts.contains(cand))
-					cur.insertText(isInteger(step.matrix.at(r).at(c)) ? QString("%1").arg(step.matrix.at(r).at(c)) : QString("%1").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()), fmt_alternate);
-				else
-					cur.insertText(isInteger(step.matrix.at(r).at(c)) ? QString("%1").arg(step.matrix.at(r).at(c)) : QString("%1").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()), fmt_default);
-			}
-		}
-		QCoreApplication::processEvents();
-	}
-
-	cur.movePosition(QTextCursor::End);
+                cand.nRow = r;
+                cand.nCol = c;
+                if (step.alts.contains(cand))
+                    cur.insertText(isInteger(step.matrix.at(r).at(c)) ? QString("%1").arg(step.matrix.at(r).at(c)) : QString("%1").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()), fmt_alternate);
+                else
+                    cur.insertText(isInteger(step.matrix.at(r).at(c)) ? QString("%1").arg(step.matrix.at(r).at(c)) : QString("%1").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt()), fmt_default);
+            }
+        }
+        QCoreApplication::processEvents();
+    }
+
+    cur.movePosition(QTextCursor::End);
 }
 
 void MainWindow::retranslateUi(bool all)
 {
-	if (all)
-		Ui_MainWindow::retranslateUi(this);
-
-	loadStyleList();
-	loadToolbarList();
+    if (all)
+        Ui_MainWindow::retranslateUi(this);
+
+    loadStyleList();
+    loadToolbarList();
 
 #ifndef QT_NO_PRINTER
-	actionFilePrintPreview->setText(tr("P&rint Preview..."));
+    actionFilePrintPreview->setText(tr("P&rint Preview..."));
 #ifndef QT_NO_TOOLTIP
-	actionFilePrintPreview->setToolTip(tr("Preview solution results"));
+    actionFilePrintPreview->setToolTip(tr("Preview solution results"));
 #endif // QT_NO_TOOLTIP
 #ifndef QT_NO_STATUSTIP
-	actionFilePrintPreview->setStatusTip(tr("Preview current solution results before printing"));
-	actionFileExit->setStatusTip(tr("Exit %1").arg(QCoreApplication::applicationName()));
+    actionFilePrintPreview->setStatusTip(tr("Preview current solution results before printing"));
+    actionFileExit->setStatusTip(tr("Exit %1").arg(QCoreApplication::applicationName()));
 #endif // QT_NO_STATUSTIP
 
-	actionFilePrint->setText(tr("&Print..."));
+    actionFilePrint->setText(tr("&Print..."));
 #ifndef QT_NO_TOOLTIP
-	actionFilePrint->setToolTip(tr("Print solution"));
+    actionFilePrint->setToolTip(tr("Print solution"));
 #endif // QT_NO_TOOLTIP
 #ifndef QT_NO_STATUSTIP
-	actionFilePrint->setStatusTip(tr("Print current solution results"));
+    actionFilePrint->setStatusTip(tr("Print current solution results"));
 #endif // QT_NO_STATUSTIP
-	actionFilePrint->setShortcut(tr("Ctrl+P"));
+    actionFilePrint->setShortcut(tr("Ctrl+P"));
 #endif // QT_NO_PRINTER
 
 #ifndef HANDHELD
-	actionSettingsToolbarsConfigure->setText(tr("Configure..."));
+    actionSettingsToolbarsConfigure->setText(tr("Configure..."));
 #ifndef QT_NO_STATUSTIP
-	actionSettingsToolbarsConfigure->setStatusTip(tr("Customize toolbars"));
+    actionSettingsToolbarsConfigure->setStatusTip(tr("Customize toolbars"));
 #endif // QT_NO_STATUSTIP
 #endif // HANDHELD
 
 #ifndef QT_NO_STATUSTIP
-	actionHelpReportBug->setStatusTip(tr("Report about a bug in %1").arg(QCoreApplication::applicationName()));
+    actionHelpReportBug->setStatusTip(tr("Report about a bug in %1").arg(QCoreApplication::applicationName()));
 #endif // QT_NO_STATUSTIP
-	if (actionHelpCheck4Updates != NULL) {
-		actionHelpCheck4Updates->setText(tr("Check for &Updates..."));
+    if (actionHelpCheck4Updates != NULL) {
+        actionHelpCheck4Updates->setText(tr("Check for &Updates..."));
 #ifndef QT_NO_STATUSTIP
-		actionHelpCheck4Updates->setStatusTip(tr("Check for %1 updates").arg(QCoreApplication::applicationName()));
+        actionHelpCheck4Updates->setStatusTip(tr("Check for %1 updates").arg(QCoreApplication::applicationName()));
 #endif // QT_NO_STATUSTIP
-	}
+    }
 #ifndef QT_NO_STATUSTIP
-	actionHelpAbout->setStatusTip(tr("About %1").arg(QCoreApplication::applicationName()));
+    actionHelpAbout->setStatusTip(tr("About %1").arg(QCoreApplication::applicationName()));
 #endif // QT_NO_STATUSTIP
 }
@@ -1485,185 +1485,185 @@
 bool MainWindow::saveTask() {
 QStringList filters(tr("%1 Task File").arg("TSPSG") + " (*.tspt)");
-	filters.append(tr("All Files") + " (*)");
+    filters.append(tr("All Files") + " (*)");
 QString file;
-	if ((fileName == tr("Untitled") + ".tspt") && settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) {
-		file = settings->value(OS"/LastUsed/TaskSavePath").toString();
-		if (!file.isEmpty())
-			file.append("/");
-		file.append(fileName);
-	} else if (fileName.endsWith(".tspt", Qt::CaseInsensitive))
-		file = fileName;
-	else
-		file = QFileInfo(fileName).path() + "/" + QFileInfo(fileName).completeBaseName() + ".tspt";
+    if ((fileName == tr("Untitled") + ".tspt") && settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) {
+        file = settings->value(OS"/LastUsed/TaskSavePath").toString();
+        if (!file.isEmpty())
+            file.append("/");
+        file.append(fileName);
+    } else if (fileName.endsWith(".tspt", Qt::CaseInsensitive))
+        file = fileName;
+    else
+        file = QFileInfo(fileName).path() + "/" + QFileInfo(fileName).completeBaseName() + ".tspt";
 
 QFileDialog::Options opts = settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool() ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog;
-	file = QFileDialog::getSaveFileName(this, tr("Task Save"), file, filters.join(";;"), NULL, opts);
-	if (file.isEmpty())
-		return false;
-	else if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
-		settings->setValue(OS"/LastUsed/TaskSavePath", QFileInfo(file).path());
-
-	if (tspmodel->saveTask(file)) {
-		setFileName(file);
-		setWindowModified(false);
-		return true;
-	}
-	return false;
+    file = QFileDialog::getSaveFileName(this, tr("Task Save"), file, filters.join(";;"), NULL, opts);
+    if (file.isEmpty())
+        return false;
+    else if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
+        settings->setValue(OS"/LastUsed/TaskSavePath", QFileInfo(file).path());
+
+    if (tspmodel->saveTask(file)) {
+        setFileName(file);
+        setWindowModified(false);
+        return true;
+    }
+    return false;
 }
 
 void MainWindow::setFileName(const QString &fileName)
 {
-	this->fileName = fileName;
-	setWindowTitle(QString("%1[*] - %2").arg(QFileInfo(fileName).completeBaseName()).arg(QCoreApplication::applicationName()));
+    this->fileName = fileName;
+    setWindowTitle(QString("%1[*] - %2").arg(QFileInfo(fileName).completeBaseName()).arg(QCoreApplication::applicationName()));
 }
 
 void MainWindow::setupUi()
 {
-	Ui_MainWindow::setupUi(this);
-
-	// File Menu
-	actionFileNew->setIcon(GET_ICON("document-new"));
-	actionFileOpen->setIcon(GET_ICON("document-open"));
-	actionFileSave->setIcon(GET_ICON("document-save"));
+    Ui_MainWindow::setupUi(this);
+
+    // File Menu
+    actionFileNew->setIcon(GET_ICON("document-new"));
+    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
+    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"));
+    menuSettingsLanguage->setIcon(GET_ICON("preferences-desktop-locale"));
 #if QT_VERSION >= 0x040600
-	actionSettingsLanguageEnglish->setIcon(QIcon::fromTheme("flag-gb", QIcon(":/images/icons/l10n/flag-gb.png")));
+    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"));
+    actionSettingsLanguageEnglish->setIcon(QIcon(":/images/icons/l10n/flag-gb.png"));
 #endif // QT_VERSION >= 0x040600
-	menuSettingsStyle->setIcon(GET_ICON("preferences-desktop-theme"));
+    menuSettingsStyle->setIcon(GET_ICON("preferences-desktop-theme"));
 #endif // HANDHELD
-	actionSettingsPreferences->setIcon(GET_ICON("preferences-system"));
-	// Help Menu
+    actionSettingsPreferences->setIcon(GET_ICON("preferences-system"));
+    // Help Menu
 #ifndef HANDHELD
-	actionHelpContents->setIcon(GET_ICON("help-contents"));
-	actionHelpContextual->setIcon(GET_ICON("help-contextual"));
-	actionHelpOnlineSupport->setIcon(GET_ICON("applications-internet"));
-	actionHelpReportBug->setIcon(GET_ICON("tools-report-bug"));
-	actionHelpAbout->setIcon(GET_ICON("help-about"));
-	actionHelpAboutQt->setIcon(QIcon(":/images/icons/"ICON_SIZE"/qtlogo."ICON_FORMAT));
-#endif
-	// Buttons
-	buttonRandom->setIcon(GET_ICON("roll"));
-	buttonSolve->setIcon(GET_ICON("dialog-ok"));
-	buttonSaveSolution->setIcon(GET_ICON("document-save-as"));
-	buttonBackToTask->setIcon(GET_ICON("go-previous"));
+    actionHelpContents->setIcon(GET_ICON("help-contents"));
+    actionHelpContextual->setIcon(GET_ICON("help-contextual"));
+    actionHelpOnlineSupport->setIcon(GET_ICON("applications-internet"));
+    actionHelpReportBug->setIcon(GET_ICON("tools-report-bug"));
+    actionHelpAbout->setIcon(GET_ICON("help-about"));
+    actionHelpAboutQt->setIcon(QIcon(":/images/icons/"ICON_SIZE"/qtlogo."ICON_FORMAT));
+#endif
+    // Buttons
+    buttonRandom->setIcon(GET_ICON("roll"));
+    buttonSolve->setIcon(GET_ICON("dialog-ok"));
+    buttonSaveSolution->setIcon(GET_ICON("document-save-as"));
+    buttonBackToTask->setIcon(GET_ICON("go-previous"));
 
 //	action->setIcon(GET_ICON(""));
 
 #if QT_VERSION >= 0x040600
-	setToolButtonStyle(Qt::ToolButtonFollowStyle);
+    setToolButtonStyle(Qt::ToolButtonFollowStyle);
 #endif
 
 #ifndef HANDHELD
 QStatusBar *statusbar = new QStatusBar(this);
-	statusbar->setObjectName("statusbar");
-	setStatusBar(statusbar);
+    statusbar->setObjectName("statusbar");
+    setStatusBar(statusbar);
 #endif // HANDHELD
 
 #ifdef Q_WS_WINCE_WM
-	menuBar()->setDefaultAction(menuFile->menuAction());
+    menuBar()->setDefaultAction(menuFile->menuAction());
 
 QScrollArea *scrollArea = new QScrollArea(this);
-	scrollArea->setFrameShape(QFrame::NoFrame);
-	scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-	scrollArea->setWidgetResizable(true);
-	scrollArea->setWidget(tabWidget);
-	setCentralWidget(scrollArea);
+    scrollArea->setFrameShape(QFrame::NoFrame);
+    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    scrollArea->setWidgetResizable(true);
+    scrollArea->setWidget(tabWidget);
+    setCentralWidget(scrollArea);
 #else
-	setCentralWidget(tabWidget);
+    setCentralWidget(tabWidget);
 #endif // Q_WS_WINCE_WM
 
-	//! \hack HACK: A little hack for toolbar icons to have a sane size.
+    //! \hack HACK: A little hack for toolbar icons to have a sane size.
 #if defined(HANDHELD) && !defined(Q_WS_MAEMO_5)
-	toolBarMain->setIconSize(QSize(logicalDpiX() / 4, logicalDpiY() / 4));
+    toolBarMain->setIconSize(QSize(logicalDpiX() / 4, logicalDpiY() / 4));
 #endif // HANDHELD
 QToolButton *tb = static_cast<QToolButton *>(toolBarMain->widgetForAction(actionFileSave));
-	if (tb != NULL)	 {
-		tb->setMenu(menuFileSaveAs);
-		tb->setPopupMode(QToolButton::MenuButtonPopup);
-	}
+    if (tb != NULL)	 {
+        tb->setMenu(menuFileSaveAs);
+        tb->setPopupMode(QToolButton::MenuButtonPopup);
+    }
 
 //	solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(DEF_FONT_FAMILY, DEF_FONT_SIZE)).value<QFont>());
-	solutionText->setWordWrapMode(QTextOption::WordWrap);
+    solutionText->setWordWrapMode(QTextOption::WordWrap);
 
 #ifndef QT_NO_PRINTER
-	actionFilePrintPreview = new QAction(this);
-	actionFilePrintPreview->setObjectName("actionFilePrintPreview");
-	actionFilePrintPreview->setEnabled(false);
-	actionFilePrintPreview->setIcon(GET_ICON("document-print-preview"));
-
-	actionFilePrint = new QAction(this);
-	actionFilePrint->setObjectName("actionFilePrint");
-	actionFilePrint->setEnabled(false);
-	actionFilePrint->setIcon(GET_ICON("document-print"));
-
-	menuFile->insertAction(actionFileExit,actionFilePrintPreview);
-	menuFile->insertAction(actionFileExit,actionFilePrint);
-	menuFile->insertSeparator(actionFileExit);
-
-	toolBarMain->insertAction(actionSettingsPreferences, actionFilePrint);
+    actionFilePrintPreview = new QAction(this);
+    actionFilePrintPreview->setObjectName("actionFilePrintPreview");
+    actionFilePrintPreview->setEnabled(false);
+    actionFilePrintPreview->setIcon(GET_ICON("document-print-preview"));
+
+    actionFilePrint = new QAction(this);
+    actionFilePrint->setObjectName("actionFilePrint");
+    actionFilePrint->setEnabled(false);
+    actionFilePrint->setIcon(GET_ICON("document-print"));
+
+    menuFile->insertAction(actionFileExit,actionFilePrintPreview);
+    menuFile->insertAction(actionFileExit,actionFilePrint);
+    menuFile->insertSeparator(actionFileExit);
+
+    toolBarMain->insertAction(actionSettingsPreferences, actionFilePrint);
 #endif // QT_NO_PRINTER
 
-	groupSettingsLanguageList = new QActionGroup(this);
+    groupSettingsLanguageList = new QActionGroup(this);
 #ifdef Q_WS_MAEMO_5
-	groupSettingsLanguageList->addAction(actionSettingsLanguageAutodetect);
-#endif
-	actionSettingsLanguageEnglish->setData("en");
-	actionSettingsLanguageEnglish->setActionGroup(groupSettingsLanguageList);
-	loadLangList();
-	actionSettingsLanguageAutodetect->setChecked(settings->value("Language", "").toString().isEmpty());
-
-	actionSettingsStyleSystem->setData(true);
-	groupSettingsStyleList = new QActionGroup(this);
+    groupSettingsLanguageList->addAction(actionSettingsLanguageAutodetect);
+#endif
+    actionSettingsLanguageEnglish->setData("en");
+    actionSettingsLanguageEnglish->setActionGroup(groupSettingsLanguageList);
+    loadLangList();
+    actionSettingsLanguageAutodetect->setChecked(settings->value("Language", "").toString().isEmpty());
+
+    actionSettingsStyleSystem->setData(true);
+    groupSettingsStyleList = new QActionGroup(this);
 #ifdef Q_WS_MAEMO_5
-	groupSettingsStyleList->addAction(actionSettingsStyleSystem);
+    groupSettingsStyleList->addAction(actionSettingsStyleSystem);
 #endif
 
 #ifndef HANDHELD
-	actionSettingsToolbarsConfigure = new QAction(this);
-	actionSettingsToolbarsConfigure->setIcon(GET_ICON("configure-toolbars"));
+    actionSettingsToolbarsConfigure = new QAction(this);
+    actionSettingsToolbarsConfigure->setIcon(GET_ICON("configure-toolbars"));
 #endif // HANDHELD
 
-	if (hasUpdater()) {
-		actionHelpCheck4Updates = new QAction(this);
-		actionHelpCheck4Updates->setIcon(GET_ICON("system-software-update"));
-		actionHelpCheck4Updates->setEnabled(hasUpdater());
-		menuHelp->insertAction(actionHelpAboutQt, actionHelpCheck4Updates);
-		menuHelp->insertSeparator(actionHelpAboutQt);
-	} else
-		actionHelpCheck4Updates = NULL;
-
-	spinCities->setMaximum(MAX_NUM_CITIES);
+    if (hasUpdater()) {
+        actionHelpCheck4Updates = new QAction(this);
+        actionHelpCheck4Updates->setIcon(GET_ICON("system-software-update"));
+        actionHelpCheck4Updates->setEnabled(hasUpdater());
+        menuHelp->insertAction(actionHelpAboutQt, actionHelpCheck4Updates);
+        menuHelp->insertSeparator(actionHelpAboutQt);
+    } else
+        actionHelpCheck4Updates = NULL;
+
+    spinCities->setMaximum(MAX_NUM_CITIES);
 
 #ifndef HANDHELD
-	toolBarManager = new QtToolBarManager;
-	toolBarManager->setMainWindow(this);
+    toolBarManager = new QtToolBarManager;
+    toolBarManager->setMainWindow(this);
 QString cat = toolBarMain->windowTitle();
-	toolBarManager->addToolBar(toolBarMain, cat);
+    toolBarManager->addToolBar(toolBarMain, cat);
 #ifndef QT_NO_PRINTER
-	toolBarManager->addAction(actionFilePrintPreview, cat);
+    toolBarManager->addAction(actionFilePrintPreview, cat);
 #endif // QT_NO_PRINTER
-	toolBarManager->addAction(actionHelpContents, cat);
-	toolBarManager->addAction(actionHelpContextual, cat);
+    toolBarManager->addAction(actionHelpContents, cat);
+    toolBarManager->addAction(actionHelpContextual, cat);
 //	toolBarManager->addAction(action, cat);
-	toolBarManager->restoreState(settings->value("MainWindow/Toolbars").toByteArray());
+    toolBarManager->restoreState(settings->value("MainWindow/Toolbars").toByteArray());
 #else
-	toolBarMain->setVisible(settings->value("MainWindow/ToolbarVisible", true).toBool());
+    toolBarMain->setVisible(settings->value("MainWindow/ToolbarVisible", true).toBool());
 #endif // HANDHELD
 
-	retranslateUi(false);
-
-#ifdef Q_WS_WIN32
-	// Adding some eyecandy in Vista and 7 :-)
-	if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
-		toggleTranclucency(true);
-	}
+    retranslateUi(false);
+
+#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_WS_WIN32
 }
@@ -1671,10 +1671,10 @@
 void MainWindow::toggleSolutionActions(bool enable)
 {
-	buttonSaveSolution->setEnabled(enable);
-	actionFileSaveAsSolution->setEnabled(enable);
-	solutionText->setEnabled(enable);
+    buttonSaveSolution->setEnabled(enable);
+    actionFileSaveAsSolution->setEnabled(enable);
+    solutionText->setEnabled(enable);
 #ifndef QT_NO_PRINTER
-	actionFilePrint->setEnabled(enable);
-	actionFilePrintPreview->setEnabled(enable);
+    actionFilePrint->setEnabled(enable);
+    actionFilePrintPreview->setEnabled(enable);
 #endif // QT_NO_PRINTER
 }
@@ -1683,11 +1683,11 @@
 {
 #ifdef Q_WS_WIN32
-	toggleStyle(labelVariant, enable);
-	toggleStyle(labelCities, enable);
-	toggleStyle(statusBar(), enable);
-	tabWidget->setDocumentMode(enable);
-	QtWin::enableBlurBehindWindow(this, enable);
+    toggleStyle(labelVariant, enable);
+    toggleStyle(labelCities, enable);
+    toggleStyle(statusBar(), enable);
+    tabWidget->setDocumentMode(enable);
+    QtWin::enableBlurBehindWindow(this, enable);
 #else
-	Q_UNUSED(enable);
+    Q_UNUSED(enable);
 #endif // Q_WS_WIN32
 }
@@ -1695,9 +1695,9 @@
 void MainWindow::actionHelpOnlineSupportTriggered()
 {
-	QDesktopServices::openUrl(QUrl("http://tspsg.info/goto/support"));
+    QDesktopServices::openUrl(QUrl("http://tspsg.info/goto/support"));
 }
 
 void MainWindow::actionHelpReportBugTriggered()
 {
-	QDesktopServices::openUrl(QUrl("http://tspsg.info/goto/bugtracker"));
-}
+    QDesktopServices::openUrl(QUrl("http://tspsg.info/goto/bugtracker"));
+}
Index: /trunk/src/mainwindow.h
===================================================================
--- /trunk/src/mainwindow.h	(revision 148)
+++ /trunk/src/mainwindow.h	(revision 149)
@@ -37,6 +37,6 @@
 
 #ifdef Q_WS_WIN32
-	// Forward declaration. A real one is in shobjidl.h
-	struct ITaskbarList3;
+    // Forward declaration. A real one is in shobjidl.h
+    struct ITaskbarList3;
 #endif
 
@@ -49,108 +49,108 @@
 class MainWindow: public QMainWindow, Ui::MainWindow
 {
-	Q_OBJECT
+    Q_OBJECT
 
 public:
-	MainWindow(QWidget *parent = 0);
-	~MainWindow();
+    MainWindow(QWidget *parent = 0);
+    ~MainWindow();
 
 private slots:
 // Actions
-	void actionFileNewTriggered();
-	void actionFileOpenTriggered();
-	bool actionFileSaveTriggered();
-	void actionFileSaveAsTaskTriggered();
-	void actionFileSaveAsSolutionTriggered();
+    void actionFileNewTriggered();
+    void actionFileOpenTriggered();
+    bool actionFileSaveTriggered();
+    void actionFileSaveAsTaskTriggered();
+    void actionFileSaveAsSolutionTriggered();
 #ifndef QT_NO_PRINTER
-	void actionFilePrintPreviewTriggered();
-	void actionFilePrintTriggered();
+    void actionFilePrintPreviewTriggered();
+    void actionFilePrintTriggered();
 #endif // QT_NO_PRINTER
-	void actionSettingsPreferencesTriggered();
-	void actionSettingsLanguageAutodetectTriggered(bool checked);
-	void groupSettingsLanguageListTriggered(QAction *action);
-	void actionSettingsStyleSystemTriggered(bool checked);
-	void groupSettingsStyleListTriggered(QAction *action);
+    void actionSettingsPreferencesTriggered();
+    void actionSettingsLanguageAutodetectTriggered(bool checked);
+    void groupSettingsLanguageListTriggered(QAction *action);
+    void actionSettingsStyleSystemTriggered(bool checked);
+    void groupSettingsStyleListTriggered(QAction *action);
 #ifndef HANDHELD
-	void actionSettingsToolbarsConfigureTriggered();
+    void actionSettingsToolbarsConfigureTriggered();
 #endif // HANDHELD
-	void actionHelpOnlineSupportTriggered();
-	void actionHelpReportBugTriggered();
-	void actionHelpCheck4UpdatesTriggered();
-	void actionHelpAboutTriggered();
+    void actionHelpOnlineSupportTriggered();
+    void actionHelpReportBugTriggered();
+    void actionHelpCheck4UpdatesTriggered();
+    void actionHelpAboutTriggered();
 // Buttons
-	void buttonBackToTaskClicked();
-	void buttonRandomClicked();
-	void buttonSolveClicked();
+    void buttonBackToTaskClicked();
+    void buttonRandomClicked();
+    void buttonSolveClicked();
 
-	void dataChanged();
-	void dataChanged(const QModelIndex &tl, const QModelIndex &br);
+    void dataChanged();
+    void dataChanged(const QModelIndex &tl, const QModelIndex &br);
 #ifdef Q_WS_WINCE_WM
-	void changeEvent(QEvent *ev);
-	void desktopResized(int screen);
+    void changeEvent(QEvent *ev);
+    void desktopResized(int screen);
 #endif // Q_WS_WINCE_WM
-	void numCitiesChanged(int nCities);
+    void numCitiesChanged(int nCities);
 #ifndef QT_NO_PRINTER
-	void printPreview(QPrinter *printer);
+    void printPreview(QPrinter *printer);
 #endif // QT_NO_PRINTER
 #ifdef Q_WS_WIN32
-	void solverRoutePartFound(int n);
+    void solverRoutePartFound(int n);
 #endif // Q_WS_WIN32
-	void spinCitiesValueChanged(int nCities);
+    void spinCitiesValueChanged(int nCities);
 
 private:
-	QString fileName;
-	QActionGroup *groupSettingsLanguageList;
-	QActionGroup *groupSettingsStyleList;
+    QString fileName;
+    QActionGroup *groupSettingsLanguageList;
+    QActionGroup *groupSettingsStyleList;
 #ifndef HANDHELD
-	QAction *actionSettingsToolbarsConfigure;
-	QtToolBarManager *toolBarManager;
+    QAction *actionSettingsToolbarsConfigure;
+    QtToolBarManager *toolBarManager;
 #endif // HANDHELD
 #ifndef QT_NO_PRINTER
-	QPrinter *printer;
-	QAction *actionFilePrintPreview;
-	QAction *actionFilePrint;
+    QPrinter *printer;
+    QAction *actionFilePrintPreview;
+    QAction *actionFilePrint;
 #endif // QT_NO_PRINTER
-	QAction *actionHelpCheck4Updates;
-	QSettings *settings;
-	CTSPModel *tspmodel;
+    QAction *actionHelpCheck4Updates;
+    QSettings *settings;
+    CTSPModel *tspmodel;
 #ifdef Q_WS_WINCE_WM
-	QRect currentGeometry;
+    QRect currentGeometry;
 #endif // Q_WS_WINCE_WM
 
 #ifdef Q_WS_WIN32
-	ITaskbarList3 *tl;
+    ITaskbarList3 *tl;
 #endif // Q_WS_WIN32
 
-	// The solution graph SVG
-	QPicture graph;
+    // The solution graph SVG
+    QPicture graph;
 
-	// Formats
-	QTextTableFormat fmt_table;
-	QTextBlockFormat fmt_paragraph,
-		fmt_cell;
-	QTextCharFormat fmt_default,
-		fmt_selected,
-		fmt_alternate,
-		fmt_altlist;
+    // Formats
+    QTextTableFormat fmt_table;
+    QTextBlockFormat fmt_paragraph,
+        fmt_cell;
+    QTextCharFormat fmt_default,
+        fmt_selected,
+        fmt_alternate,
+        fmt_altlist;
 
-	void check4Updates(bool silent = false);
-	void closeEvent(QCloseEvent *ev);
-	void dragEnterEvent(QDragEnterEvent *ev);
-	void drawNode(QPainter &pic, int nstep, bool left = false, SStep *step = NULL);
-	void dropEvent(QDropEvent *ev);
-	void initDocStyleSheet();
-	void loadLangList();
-	bool loadLanguage(const QString &lang = QString());
-	void loadStyleList();
-	void loadToolbarList();
-	bool maybeSave();
-	void outputMatrix(QTextCursor &cur, const TMatrix &matrix);
-	void outputMatrix(QTextCursor &cur, const SStep &step);
-	void retranslateUi(bool all = true);
-	bool saveTask();
-	void setFileName(const QString &fileName = tr("Untitled") + ".tspt");
-	void setupUi();
-	void toggleSolutionActions(bool enable = true);
-	void toggleTranclucency(bool enable);
+    void check4Updates(bool silent = false);
+    void closeEvent(QCloseEvent *ev);
+    void dragEnterEvent(QDragEnterEvent *ev);
+    void drawNode(QPainter &pic, int nstep, bool left = false, SStep *step = NULL);
+    void dropEvent(QDropEvent *ev);
+    void initDocStyleSheet();
+    void loadLangList();
+    bool loadLanguage(const QString &lang = QString());
+    void loadStyleList();
+    void loadToolbarList();
+    bool maybeSave();
+    void outputMatrix(QTextCursor &cur, const TMatrix &matrix);
+    void outputMatrix(QTextCursor &cur, const SStep &step);
+    void retranslateUi(bool all = true);
+    bool saveTask();
+    void setFileName(const QString &fileName = tr("Untitled") + ".tspt");
+    void setupUi();
+    void toggleSolutionActions(bool enable = true);
+    void toggleTranclucency(bool enable);
 };
 
Index: /trunk/src/os.h
===================================================================
--- /trunk/src/os.h	(revision 148)
+++ /trunk/src/os.h	(revision 149)
@@ -39,17 +39,17 @@
  */
 #if defined(__amd64__) || defined(_M_X64)
-#	define ARCH " (AMD 64-bit)"
+#   define ARCH " (AMD 64-bit)"
 #elif defined(__ia64__) || defined(_M_IA64)
-#	define ARCH " (Intel 64-bit)"
+#   define ARCH " (Intel 64-bit)"
 #elif defined(__i386__) || defined(_M_IX86) || defined(_X86_)
-#	define ARCH " (Intel x86)"
+#   define ARCH " (Intel x86)"
 #elif defined(__powerpc__) || defined(_M_PPC)
-#	define ARCH " (PowerPC)"
+#   define ARCH " (PowerPC)"
 #elif defined(__arm__) || defined(_M_ARM)
-#	define ARCH " (ARM)"
+#   define ARCH " (ARM)"
 #elif defined(__mips__) || defined(_M_MRX000)
-#	define ARCH " (MIPS)"
+#   define ARCH " (MIPS)"
 #else
-#	define ARCH ""
+#   define ARCH ""
 #endif // ARCH
 
@@ -66,90 +66,90 @@
  */
 #ifdef Q_OS_AIX
-#	define OS "AIX"
-#	define OSID quint8(1)
+#   define OS "AIX"
+#   define OSID quint8(1)
 #elif defined(Q_OS_BSDI)
-#	define OS "BSD/OS"
-#	define OSID quint8(2)
+#   define OS "BSD/OS"
+#   define OSID quint8(2)
 #elif defined(Q_OS_CYGWIN)
-#	define OS "Cygwin"
-#	define OSID quint8(3)
+#   define OS "Cygwin"
+#   define OSID quint8(3)
 #elif defined(Q_OS_DARWIN)
-#	define OS "Mac OS (Darwin)"
-#	define OSID quint8(4)
+#   define OS "Mac OS (Darwin)"
+#   define OSID quint8(4)
 #elif defined(Q_OS_DGUX)
-#	define OS "DG/UX"
-#	define OSID quint8(5)
+#   define OS "DG/UX"
+#   define OSID quint8(5)
 #elif defined(Q_OS_DYNIX)
-#	define OS "DYNIX/ptx"
-#	define OSID quint8(6)
+#   define OS "DYNIX/ptx"
+#   define OSID quint8(6)
 #elif defined(Q_OS_FREEBSD)
-#	define OS "FreeBSD"
-#	define OSID quint8(7)
+#   define OS "FreeBSD"
+#   define OSID quint8(7)
 #elif defined(Q_OS_HPUX)
-#	define OS "HP-UX"
-#	define OSID quint8(8)
+#   define OS "HP-UX"
+#   define OSID quint8(8)
 #elif defined(Q_OS_HURD)
-#	define OS "GNU Hurd"
-#	define OSID quint8(9)
+#   define OS "GNU Hurd"
+#   define OSID quint8(9)
 #elif defined(Q_OS_IRIX)
-#	define OS "SGI Irix"
-#	define OSID quint8(10)
+#   define OS "SGI Irix"
+#   define OSID quint8(10)
 #elif defined(Q_OS_LINUX)
-#	define OS "Linux"
-#	define OSID quint8(11)
+#   define OS "Linux"
+#   define OSID quint8(11)
 #elif defined(Q_OS_LYNX)
-#	define OS "LynxOS"
-#	define OSID quint8(12)
+#   define OS "LynxOS"
+#   define OSID quint8(12)
 #elif defined(Q_OS_NETBSD)
-#	define OS "NetBSD"
-#	define OSID quint8(13)
+#   define OS "NetBSD"
+#   define OSID quint8(13)
 #elif defined(Q_OS_OPENBSD)
-#	define OS "OpenBSD"
-#	define OSID quint8(14)
+#   define OS "OpenBSD"
+#   define OSID quint8(14)
 #elif defined(Q_OS_OS2EMX)
-#	define OS "OS/2"
-#	define OSID quint8(15)
+#   define OS "OS/2"
+#   define OSID quint8(15)
 #elif defined(Q_OS_OSF)
-#	define OS "HP Tru64 UNIX"
-#	define OSID quint8(16)
+#   define OS "HP Tru64 UNIX"
+#   define OSID quint8(16)
 #elif defined(Q_OS_QNX)
-#	define OS "QNX Neutrino"
-#	define OSID quint8(17)
+#   define OS "QNX Neutrino"
+#   define OSID quint8(17)
 #elif defined(Q_OS_RELIANT)
-#	define OS "Reliant UNIX"
-#	define OSID quint8(18)
+#   define OS "Reliant UNIX"
+#   define OSID quint8(18)
 #elif defined(Q_OS_SCO)
-#	define OS "SCO OpenServer 5"
-#	define OSID quint8(19)
+#   define OS "SCO OpenServer 5"
+#   define OSID quint8(19)
 #elif defined(Q_OS_SOLARIS)
-#	define OS "Sun Solaris"
-#	define OSID quint8(20)
+#   define OS "Sun Solaris"
+#   define OSID quint8(20)
 #elif defined(Q_OS_SYMBIAN)
-#	define OS "Symbian"
-#	define OSID quint8(21)
+#   define OS "Symbian"
+#   define OSID quint8(21)
 #elif defined(Q_OS_ULTRIX)
-#	define OS "DEC Ultrix"
-#	define OSID quint8(22)
+#   define OS "DEC Ultrix"
+#   define OSID quint8(22)
 #elif defined(Q_OS_UNIXWARE)
-#	define OS "UnixWare 7/Open UNIX 8"
-#	define OSID quint8(23)
+#   define OS "UnixWare 7/Open UNIX 8"
+#   define OSID quint8(23)
 #elif defined(Q_OS_WIN32)
-#	define OS "Windows"
-#	define OSID quint8(24)
+#   define OS "Windows"
+#   define OSID quint8(24)
 #elif defined(Q_OS_WINCE_WM)
-#	define OS "Windows Mobile"
-#	define OSID quint8(25)
+#   define OS "Windows Mobile"
+#   define OSID quint8(25)
 #elif defined(Q_OS_WINCE)
-#	define OS "Windows CE"
-#	define OSID quint8(26)
+#   define OS "Windows CE"
+#   define OSID quint8(26)
 #elif defined(Q_OS_BSD4)
-#	define OS "BSD 4.4"
-#	define OSID quint8(253)
+#   define OS "BSD 4.4"
+#   define OSID quint8(253)
 #elif defined(Q_OS_UNIX)
-#	define OS "UNIX BSD/SYSV"
-#	define OSID quint8(254)
+#   define OS "UNIX BSD/SYSV"
+#   define OSID quint8(254)
 #else
-#	define OS "Unknown"
-#	define OSID quint8(255)
+#   define OS "Unknown"
+#   define OSID quint8(255)
 #endif // OS
 
@@ -162,19 +162,19 @@
  */
 #ifdef Q_CC_INTEL
-#	define COMPILER "Intel C++"
+#   define COMPILER "Intel C++"
 #elif defined(Q_CC_MSVC)
-#	define COMPILER "Microsoft Visual C/C++"
+#   define COMPILER "Microsoft Visual C/C++"
 #elif defined(Q_CC_MINGW)
-#	define COMPILER "MinGW GCC"
+#   define COMPILER "MinGW GCC"
 #elif defined(Q_CC_GNU)
-#	define COMPILER "GNU C++"
+#   define COMPILER "GNU C++"
 #elif defined(Q_CC_GCCE)
-#	define COMPILER "GCCE (Symbian GCCE builds)"
+#   define COMPILER "GCCE (Symbian GCCE builds)"
 #elif defined(Q_CC_RVCT)
-#	define COMPILER "ARM Realview Compiler Suite"
+#   define COMPILER "ARM Realview Compiler Suite"
 #elif defined(Q_CC_NOKIAX86)
-#	define COMPILER "Nokia x86 (Symbian WINSCW builds)"
+#   define COMPILER "Nokia x86 (Symbian WINSCW builds)"
 #else
-#	define COMPILER "Unknown"
+#   define COMPILER "Unknown"
 #endif
 
Index: /trunk/src/settingsdialog.cpp
===================================================================
--- /trunk/src/settingsdialog.cpp	(revision 148)
+++ /trunk/src/settingsdialog.cpp	(revision 149)
@@ -31,32 +31,32 @@
  */
 SettingsDialog::SettingsDialog(QWidget *parent)
-	: QDialog(parent), _newFont(false), _newColor(false), _translucency(0)
-{
-	setupUi(this);
-
-	setWindowIcon(GET_ICON("preferences-system"));
-
-	buttonBox->button(QDialogButtonBox::Ok)->setIcon(GET_ICON("dialog-ok"));
-#ifndef QT_NO_STATUSTIP
-	buttonBox->button(QDialogButtonBox::Ok)->setStatusTip(tr("Save new preferences"));
+    : QDialog(parent), _newFont(false), _newColor(false), _translucency(0)
+{
+    setupUi(this);
+
+    setWindowIcon(GET_ICON("preferences-system"));
+
+    buttonBox->button(QDialogButtonBox::Ok)->setIcon(GET_ICON("dialog-ok"));
+#ifndef QT_NO_STATUSTIP
+    buttonBox->button(QDialogButtonBox::Ok)->setStatusTip(tr("Save new preferences"));
 #endif
-	buttonBox->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor));
-	buttonBox->button(QDialogButtonBox::Cancel)->setIcon(GET_ICON("dialog-cancel"));
-#ifndef QT_NO_STATUSTIP
-	buttonBox->button(QDialogButtonBox::Cancel)->setStatusTip(tr("Close without saving preferences"));
+    buttonBox->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor));
+    buttonBox->button(QDialogButtonBox::Cancel)->setIcon(GET_ICON("dialog-cancel"));
+#ifndef QT_NO_STATUSTIP
+    buttonBox->button(QDialogButtonBox::Cancel)->setStatusTip(tr("Close without saving preferences"));
 #endif
-	buttonBox->button(QDialogButtonBox::Cancel)->setCursor(QCursor(Qt::PointingHandCursor));
-
-	buttonColor->setIcon(GET_ICON("format-text-color"));
-	buttonFont->setIcon(GET_ICON("preferences-desktop-font"));
-	buttonHelp->setIcon(GET_ICON("help-hint"));
+    buttonBox->button(QDialogButtonBox::Cancel)->setCursor(QCursor(Qt::PointingHandCursor));
+
+    buttonColor->setIcon(GET_ICON("format-text-color"));
+    buttonFont->setIcon(GET_ICON("preferences-desktop-font"));
+    buttonHelp->setIcon(GET_ICON("help-hint"));
 
 QPalette p = bgWhite->palette();
-	p.setColor(QPalette::Window, p.color(QPalette::Base));
-	bgWhite->setPalette(p);
-
-	p = lineHorizontal->palette();
-	p.setColor(QPalette::Window, p.color(QPalette::Text));
-	lineHorizontal->setPalette(p);
+    p.setColor(QPalette::Window, p.color(QPalette::Base));
+    bgWhite->setPalette(p);
+
+    p = lineHorizontal->palette();
+    p.setColor(QPalette::Window, p.color(QPalette::Text));
+    lineHorizontal->setPalette(p);
 
 // Layout helpers
@@ -64,49 +64,49 @@
 QHBoxLayout *hbox;
 #ifndef QT_NO_PRINTER
-	cbHQGraph = new QCheckBox(bgWhite);
-	cbHQGraph->setObjectName("cbHQGraph");
-#ifndef QT_NO_STATUSTIP
-	cbHQGraph->setStatusTip(tr("Higher quality graph looks much better when printing but uglier on the screen"));
-#endif // QT_NO_STATUSTIP
-	cbHQGraph->setText(tr("Draw solution graph in higher quality"));
-	cbHQGraph->setCursor(QCursor(Qt::PointingHandCursor));
-
-	box = static_cast<QBoxLayout *>(tabOutput->layout());
-	hbox = new QHBoxLayout();
-	hbox->addSpacing(10);
-	hbox->addWidget(cbHQGraph);
-	box->insertLayout(box->indexOf(cbShowGraph) + 1, hbox);
-	connect(cbShowGraph, SIGNAL(toggled(bool)), cbHQGraph, SLOT(setEnabled(bool)));
+    cbHQGraph = new QCheckBox(bgWhite);
+    cbHQGraph->setObjectName("cbHQGraph");
+#ifndef QT_NO_STATUSTIP
+    cbHQGraph->setStatusTip(tr("Higher quality graph looks much better when printing but uglier on the screen"));
+#endif // QT_NO_STATUSTIP
+    cbHQGraph->setText(tr("Draw solution graph in higher quality"));
+    cbHQGraph->setCursor(QCursor(Qt::PointingHandCursor));
+
+    box = static_cast<QBoxLayout *>(tabOutput->layout());
+    hbox = new QHBoxLayout();
+    hbox->addSpacing(10);
+    hbox->addWidget(cbHQGraph);
+    box->insertLayout(box->indexOf(cbShowGraph) + 1, hbox);
+    connect(cbShowGraph, SIGNAL(toggled(bool)), cbHQGraph, SLOT(setEnabled(bool)));
 #endif
 
-	if (hasUpdater()) {
-		cbCheck4Updates = new QCheckBox(bgWhite);
-		cbCheck4Updates->setObjectName("cbCheck4Updates");
-#ifndef QT_NO_STATUSTIP
-		cbCheck4Updates->setStatusTip(tr("Automatically check for updates at the given interval"));
-#endif // QT_NO_STATUSTIP
-		cbCheck4Updates->setText(tr("Check for updates every"));
-		cbCheck4Updates->setCursor(QCursor(Qt::PointingHandCursor));
-
-		spinUpdateCheckInterval = new QSpinBox(bgWhite);
-		spinUpdateCheckInterval->setObjectName("spinUpdateCheckInterval");
-#ifndef QT_NO_STATUSTIP
-		spinUpdateCheckInterval->setStatusTip(tr("Minimal interval at which to check for updates"));
-#endif // QT_NO_STATUSTIP
-		spinUpdateCheckInterval->setSuffix(tr(" days", "Don't forget a space at the beginning!"));
-		spinUpdateCheckInterval->setRange(1, 365);
-		spinUpdateCheckInterval->setCursor(QCursor(Qt::PointingHandCursor));
-
-		connect(cbCheck4Updates, SIGNAL(toggled(bool)), spinUpdateCheckInterval, SLOT(setEnabled(bool)));
-
-		box = static_cast<QBoxLayout *>(tabGeneral->layout());
-		hbox = new QHBoxLayout();
-		hbox->setSpacing(0);
-		hbox->addWidget(cbCheck4Updates);
-		hbox->addWidget(spinUpdateCheckInterval);
-		hbox->addStretch();
-		box->insertLayout(box->indexOf(cbUseNativeDialogs) + 1, hbox);
-	} else
-		cbCheck4Updates = NULL;
+    if (hasUpdater()) {
+        cbCheck4Updates = new QCheckBox(bgWhite);
+        cbCheck4Updates->setObjectName("cbCheck4Updates");
+#ifndef QT_NO_STATUSTIP
+        cbCheck4Updates->setStatusTip(tr("Automatically check for updates at the given interval"));
+#endif // QT_NO_STATUSTIP
+        cbCheck4Updates->setText(tr("Check for updates every"));
+        cbCheck4Updates->setCursor(QCursor(Qt::PointingHandCursor));
+
+        spinUpdateCheckInterval = new QSpinBox(bgWhite);
+        spinUpdateCheckInterval->setObjectName("spinUpdateCheckInterval");
+#ifndef QT_NO_STATUSTIP
+        spinUpdateCheckInterval->setStatusTip(tr("Minimal interval at which to check for updates"));
+#endif // QT_NO_STATUSTIP
+        spinUpdateCheckInterval->setSuffix(tr(" days", "Don't forget a space at the beginning!"));
+        spinUpdateCheckInterval->setRange(1, 365);
+        spinUpdateCheckInterval->setCursor(QCursor(Qt::PointingHandCursor));
+
+        connect(cbCheck4Updates, SIGNAL(toggled(bool)), spinUpdateCheckInterval, SLOT(setEnabled(bool)));
+
+        box = static_cast<QBoxLayout *>(tabGeneral->layout());
+        hbox = new QHBoxLayout();
+        hbox->setSpacing(0);
+        hbox->addWidget(cbCheck4Updates);
+        hbox->addWidget(spinUpdateCheckInterval);
+        hbox->addStretch();
+        box->insertLayout(box->indexOf(cbUseNativeDialogs) + 1, hbox);
+    } else
+        cbCheck4Updates = NULL;
 
 #ifdef HANDHELD
@@ -114,192 +114,192 @@
 
 #ifdef Q_WS_WINCE_WM
-	// On screens with small height when SIP is shown and the window is resized
-	// there is not enought space for all elements.
-	// So we show the scrollbars to be able to access them.
+    // On screens with small height when SIP is shown and the window is resized
+    // there is not enought space for all elements.
+    // So we show the scrollbars to be able to access them.
 QScrollArea *scrollArea = new QScrollArea(this);
-	scrollArea->setFrameShape(QFrame::NoFrame);
-	scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-	scrollArea->setWidgetResizable(true);
-	scrollArea->setWidget(bgWhite);
+    scrollArea->setFrameShape(QFrame::NoFrame);
+    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    scrollArea->setWidgetResizable(true);
+    scrollArea->setWidget(bgWhite);
 #else
-	buttons->insertStretch(buttons->indexOf(buttonHelp) + 1);
+    buttons->insertStretch(buttons->indexOf(buttonHelp) + 1);
 #endif // Q_WS_WINCE_WM
 
-	bgWhite->layout()->setMargin(0);
-
-	// Central layout
-	vbox1 = new QVBoxLayout(this);
-	vbox1->setMargin(0);
-	vbox1->setSpacing(0);
+    bgWhite->layout()->setMargin(0);
+
+    // Central layout
+    vbox1 = new QVBoxLayout(this);
+    vbox1->setMargin(0);
+    vbox1->setSpacing(0);
 #ifdef Q_WS_WINCE_WM
-	vbox1->addWidget(scrollArea);
+    vbox1->addWidget(scrollArea);
 #else
-	vbox1->addWidget(bgWhite);
+    vbox1->addWidget(bgWhite);
 #endif // Q_WS_WINCE_WM
-	vbox1->addWidget(bgGrey);
-	setLayout(vbox1);
+    vbox1->addWidget(bgGrey);
+    setLayout(vbox1);
 #else // HANDHELD
 QVBoxLayout *vbox; // Layout helper
 
 #ifdef Q_WS_WIN32
-	if (QtWin::isCompositionEnabled()) {
-		cbUseTranslucency = new QCheckBox(bgWhite);
-		cbUseTranslucency->setObjectName("cbUseTranslucency");
-#ifndef QT_NO_STATUSTIP
-		cbUseTranslucency->setStatusTip(tr("Use translucent effect on the Main Window under Windows Vista and 7"));
-#endif // QT_NO_STATUSTIP
-		cbUseTranslucency->setText(tr("Use translucency effects"));
-		cbUseTranslucency->setCursor(QCursor(Qt::PointingHandCursor));
-	}
+    if (QtWin::isCompositionEnabled()) {
+        cbUseTranslucency = new QCheckBox(bgWhite);
+        cbUseTranslucency->setObjectName("cbUseTranslucency");
+#ifndef QT_NO_STATUSTIP
+        cbUseTranslucency->setStatusTip(tr("Use translucent effect on the Main Window under Windows Vista and 7"));
+#endif // QT_NO_STATUSTIP
+        cbUseTranslucency->setText(tr("Use translucency effects"));
+        cbUseTranslucency->setCursor(QCursor(Qt::PointingHandCursor));
+    }
 #endif // Q_WS_WIN32
 
-	cbSaveState = new QCheckBox(bgWhite);
-	cbSaveState->setObjectName("cbSaveState");
-#ifndef QT_NO_STATUSTIP
-	cbSaveState->setStatusTip(tr("Restore main window state and position on application restart"));
-#endif // QT_NO_STATUSTIP
-	cbSaveState->setText(tr("Save main window state and position"));
-	cbSaveState->setCursor(QCursor(Qt::PointingHandCursor));
-
-	imgIcon = new QLabel(this);
-	imgIcon->setObjectName("imgIcon");
-	imgIcon->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
-	imgIcon->setFrameShape(QFrame::NoFrame);
-	imgIcon->setPixmap(GET_ICON("preferences-system").pixmap(128, 128));
-	imgIcon->setStyleSheet("background-color: #0080C0; padding-top: 11px;");
-	imgIcon->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
-	imgIcon->setMinimumWidth(150);
-
-	labelHint = new QLabel(bgGrey);
-	labelHint->setObjectName("labelHint");
-	labelHint->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
+    cbSaveState = new QCheckBox(bgWhite);
+    cbSaveState->setObjectName("cbSaveState");
+#ifndef QT_NO_STATUSTIP
+    cbSaveState->setStatusTip(tr("Restore main window state and position on application restart"));
+#endif // QT_NO_STATUSTIP
+    cbSaveState->setText(tr("Save main window state and position"));
+    cbSaveState->setCursor(QCursor(Qt::PointingHandCursor));
+
+    imgIcon = new QLabel(this);
+    imgIcon->setObjectName("imgIcon");
+    imgIcon->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
+    imgIcon->setFrameShape(QFrame::NoFrame);
+    imgIcon->setPixmap(GET_ICON("preferences-system").pixmap(128, 128));
+    imgIcon->setStyleSheet("background-color: #0080C0; padding-top: 11px;");
+    imgIcon->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
+    imgIcon->setMinimumWidth(150);
+
+    labelHint = new QLabel(bgGrey);
+    labelHint->setObjectName("labelHint");
+    labelHint->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
 //	labelHint->setMinimumSize(QSize(190,28));
-	labelHint->setMinimumSize(QSize(0,28));
-	labelHint->setMaximumSize(QSize(QWIDGETSIZE_MAX,28));
-	labelHint->setTextFormat(Qt::PlainText);
+    labelHint->setMinimumSize(QSize(0,28));
+    labelHint->setMaximumSize(QSize(QWIDGETSIZE_MAX,28));
+    labelHint->setTextFormat(Qt::PlainText);
 //	labelHint->setAlignment(Qt::AlignLeft | Qt::AlignTop);
-	labelHint->setWordWrap(true);
-#ifndef QT_NO_STATUSTIP
-	labelHint->setStatusTip(tr("Hover mouse pointer over dialog elements to get additional help"));
-#endif // QT_NO_STATUSTIP
-
-	lineVertical = new QFrame(this);
-	lineVertical->setObjectName("lineVertical");
-	lineVertical->setFrameShadow(QFrame::Plain);
-	lineVertical->setFrameShape(QFrame::VLine);
-	lineVertical->setLineWidth(2);
-
-	// Top line
-	hbox = new QHBoxLayout();
-	hbox->addWidget(imgIcon);
-	hbox->addWidget(lineVertical);
-	hbox->addWidget(bgWhite);
-
-	box = static_cast<QBoxLayout *>(tabGeneral->layout());
-	box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbSaveState);
+    labelHint->setWordWrap(true);
+#ifndef QT_NO_STATUSTIP
+    labelHint->setStatusTip(tr("Hover mouse pointer over dialog elements to get additional help"));
+#endif // QT_NO_STATUSTIP
+
+    lineVertical = new QFrame(this);
+    lineVertical->setObjectName("lineVertical");
+    lineVertical->setFrameShadow(QFrame::Plain);
+    lineVertical->setFrameShape(QFrame::VLine);
+    lineVertical->setLineWidth(2);
+
+    // Top line
+    hbox = new QHBoxLayout();
+    hbox->addWidget(imgIcon);
+    hbox->addWidget(lineVertical);
+    hbox->addWidget(bgWhite);
+
+    box = static_cast<QBoxLayout *>(tabGeneral->layout());
+    box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbSaveState);
 #ifdef Q_WS_WIN32
-	if (QtWin::isCompositionEnabled())
-		box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbUseTranslucency);
+    if (QtWin::isCompositionEnabled())
+        box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbUseTranslucency);
 #endif // Q_WS_WIN32
 
-	// Inserting label for hints to the bottom part (with grey bg)
-	buttons->insertWidget(buttons->indexOf(buttonHelp) + 1, labelHint, 1);
-
-	// Central layout
-	vbox = new QVBoxLayout(this);
-	vbox->setMargin(0);
-	vbox->setSpacing(0);
-	vbox->addLayout(hbox);
-	vbox->addWidget(bgGrey);
-	setLayout(vbox);
+    // Inserting label for hints to the bottom part (with grey bg)
+    buttons->insertWidget(buttons->indexOf(buttonHelp) + 1, labelHint, 1);
+
+    // Central layout
+    vbox = new QVBoxLayout(this);
+    vbox->setMargin(0);
+    vbox->setSpacing(0);
+    vbox->addLayout(hbox);
+    vbox->addWidget(bgGrey);
+    setLayout(vbox);
 #endif // HANDHELD
 
 #ifdef Q_WS_WINCE_WM
-	// We need to react to SIP show/hide and resize the window appropriately
-	connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int)));
+    // We need to react to SIP show/hide and resize the window appropriately
+    connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int)));
 #endif // Q_WS_WINCE_WM
-	connect(spinRandMin, SIGNAL(valueChanged(int)), SLOT(spinRandMinValueChanged(int)));
-	connect(buttonFont, SIGNAL(clicked()), SLOT(buttonFontClicked()));
-	connect(buttonColor, SIGNAL(clicked()), SLOT(buttonColorClicked()));
-	setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
+    connect(spinRandMin, SIGNAL(valueChanged(int)), SLOT(spinRandMinValueChanged(int)));
+    connect(buttonFont, SIGNAL(clicked()), SLOT(buttonFontClicked()));
+    connect(buttonColor, SIGNAL(clicked()), SLOT(buttonColorClicked()));
+    setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
 #if !defined(QT_NO_STATUSTIP) && !defined(HANDHELD)
-	// Setting initial text of dialog hint label to own status tip text.
-	labelHint->setText(labelHint->statusTip());
+    // Setting initial text of dialog hint label to own status tip text.
+    labelHint->setText(labelHint->statusTip());
 #endif // HANDHELD
 
-	settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
-	settings->remove("SettingsReset");
-
-	cbAutosize->setChecked(settings->value("Autosize", DEF_AUTOSIZE).toBool());
-	cbSaveLastUsed->setChecked(settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool());
-	cbUseNativeDialogs->setChecked(settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool());
+    settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
+    settings->remove("SettingsReset");
+
+    cbAutosize->setChecked(settings->value("Autosize", DEF_AUTOSIZE).toBool());
+    cbSaveLastUsed->setChecked(settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool());
+    cbUseNativeDialogs->setChecked(settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool());
 #ifdef Q_WS_WIN32
-	if (QtWin::isCompositionEnabled())
-		cbUseTranslucency->setChecked(settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool());
+    if (QtWin::isCompositionEnabled())
+        cbUseTranslucency->setChecked(settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool());
 #endif // Q_WS_WIN32
 #ifndef HANDHELD
-	cbSaveState->setChecked(settings->value("SavePos", DEF_SAVEPOS).toBool());
+    cbSaveState->setChecked(settings->value("SavePos", DEF_SAVEPOS).toBool());
 #endif // HANDHELD
-	if (cbCheck4Updates != NULL) {
-		settings->beginGroup("Check4Updates");
-		cbCheck4Updates->setChecked(settings->value("Enabled", DEF_CHECK_FOR_UPDATES).toBool());
-		spinUpdateCheckInterval->setValue(settings->value("Interval", DEF_UPDATE_CHECK_INTERVAL).toInt());
-		settings->endGroup();
-		spinUpdateCheckInterval->setEnabled(cbCheck4Updates->isChecked());
-	}
-
-	settings->beginGroup("Task");
-	cbSymmetricMode->setChecked(settings->value("SymmetricMode", DEF_SYMMETRIC_MODE).toBool());
-	spinFractionalAccuracy->setValue(settings->value("FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
-	spinRandMin->setMaximum(MAX_RAND_VALUE);
-	spinRandMin->setValue(settings->value("RandMin",DEF_RAND_MIN).toInt());
-	spinRandMax->setMaximum(MAX_RAND_VALUE);
-	spinRandMax->setValue(settings->value("RandMax",DEF_RAND_MAX).toInt());
-	cbFractionalRandom->setChecked(settings->value("FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool());
-	settings->endGroup();
-
-	settings->beginGroup("Output");
-	cbShowGraph->setChecked(settings->value("ShowGraph", DEF_SHOW_GRAPH).toBool());
+    if (cbCheck4Updates != NULL) {
+        settings->beginGroup("Check4Updates");
+        cbCheck4Updates->setChecked(settings->value("Enabled", DEF_CHECK_FOR_UPDATES).toBool());
+        spinUpdateCheckInterval->setValue(settings->value("Interval", DEF_UPDATE_CHECK_INTERVAL).toInt());
+        settings->endGroup();
+        spinUpdateCheckInterval->setEnabled(cbCheck4Updates->isChecked());
+    }
+
+    settings->beginGroup("Task");
+    cbSymmetricMode->setChecked(settings->value("SymmetricMode", DEF_SYMMETRIC_MODE).toBool());
+    spinFractionalAccuracy->setValue(settings->value("FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
+    spinRandMin->setMaximum(MAX_RAND_VALUE);
+    spinRandMin->setValue(settings->value("RandMin",DEF_RAND_MIN).toInt());
+    spinRandMax->setMaximum(MAX_RAND_VALUE);
+    spinRandMax->setValue(settings->value("RandMax",DEF_RAND_MAX).toInt());
+    cbFractionalRandom->setChecked(settings->value("FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool());
+    settings->endGroup();
+
+    settings->beginGroup("Output");
+    cbShowGraph->setChecked(settings->value("ShowGraph", DEF_SHOW_GRAPH).toBool());
 
 #ifndef QT_NO_PRINTER
-	cbHQGraph->setEnabled(cbShowGraph->isChecked());
-	cbHQGraph->setChecked(settings->value("HQGraph", DEF_HQ_GRAPH && cbShowGraph->isChecked()).toBool());
+    cbHQGraph->setEnabled(cbShowGraph->isChecked());
+    cbHQGraph->setChecked(settings->value("HQGraph", DEF_HQ_GRAPH && cbShowGraph->isChecked()).toBool());
 #endif
 
 #if !defined(NOSVG) && (QT_VERSION >= 0x040500)
-	comboGraphImageFormat->addItem("svg");
+    comboGraphImageFormat->addItem("svg");
 #endif // NOSVG && QT_VERSION >= 0x040500
-	// We create whitelist of formats, supported by the most popular web browsers according to
-	//  http://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support
-	//  + TIFF format (there are plugins to support it).
+    // We create whitelist of formats, supported by the most popular web browsers according to
+    //  http://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support
+    //  + TIFF format (there are plugins to support it).
 QStringList whitelist;
-	whitelist << "bmp" << "jpeg" << "png" << "tiff" << "xbm";
-	foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
-		if (whitelist.contains(format))
-			comboGraphImageFormat->addItem(format);
-	}
-	comboGraphImageFormat->model()->sort(0);
-	comboGraphImageFormat->setCurrentIndex(comboGraphImageFormat->findText(settings->value("GraphImageFormat", DEF_GRAPH_IMAGE_FORMAT).toString(), Qt::MatchFixedString));
-	if (comboGraphImageFormat->currentIndex() < 0)
-		comboGraphImageFormat->setCurrentIndex(comboGraphImageFormat->findText(DEF_GRAPH_IMAGE_FORMAT, Qt::MatchFixedString));
-	labelGraphImageFormat->setEnabled(cbShowGraph->isChecked());
-	comboGraphImageFormat->setEnabled(cbShowGraph->isChecked());
-
-	cbShowMatrix->setChecked(settings->value("ShowMatrix", DEF_SHOW_MATRIX).toBool());
-	cbCitiesLimit->setEnabled(cbShowMatrix->isChecked());
-	cbCitiesLimit->setChecked(settings->value("UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT && cbShowMatrix->isChecked()).toBool());
-	spinCitiesLimit->setEnabled(cbShowMatrix->isChecked() && cbCitiesLimit->isChecked());
-	spinCitiesLimit->setValue(settings->value("ShowMatrixLimit", DEF_SHOW_MATRIX_LIMIT).toInt());
-	spinCitiesLimit->setMaximum(MAX_NUM_CITIES);
-	cbScrollToEnd->setChecked(settings->value("ScrollToEnd", DEF_SCROLL_TO_END).toBool());
-
-	font = qvariant_cast<QFont>(settings->value("Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)));
-	color = qvariant_cast<QColor>(settings->value("Colors/Text", DEF_TEXT_COLOR));
-	settings->endGroup();
+    whitelist << "bmp" << "jpeg" << "png" << "tiff" << "xbm";
+    foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
+        if (whitelist.contains(format))
+            comboGraphImageFormat->addItem(format);
+    }
+    comboGraphImageFormat->model()->sort(0);
+    comboGraphImageFormat->setCurrentIndex(comboGraphImageFormat->findText(settings->value("GraphImageFormat", DEF_GRAPH_IMAGE_FORMAT).toString(), Qt::MatchFixedString));
+    if (comboGraphImageFormat->currentIndex() < 0)
+        comboGraphImageFormat->setCurrentIndex(comboGraphImageFormat->findText(DEF_GRAPH_IMAGE_FORMAT, Qt::MatchFixedString));
+    labelGraphImageFormat->setEnabled(cbShowGraph->isChecked());
+    comboGraphImageFormat->setEnabled(cbShowGraph->isChecked());
+
+    cbShowMatrix->setChecked(settings->value("ShowMatrix", DEF_SHOW_MATRIX).toBool());
+    cbCitiesLimit->setEnabled(cbShowMatrix->isChecked());
+    cbCitiesLimit->setChecked(settings->value("UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT && cbShowMatrix->isChecked()).toBool());
+    spinCitiesLimit->setEnabled(cbShowMatrix->isChecked() && cbCitiesLimit->isChecked());
+    spinCitiesLimit->setValue(settings->value("ShowMatrixLimit", DEF_SHOW_MATRIX_LIMIT).toInt());
+    spinCitiesLimit->setMaximum(MAX_NUM_CITIES);
+    cbScrollToEnd->setChecked(settings->value("ScrollToEnd", DEF_SCROLL_TO_END).toBool());
+
+    font = qvariant_cast<QFont>(settings->value("Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)));
+    color = qvariant_cast<QColor>(settings->value("Colors/Text", DEF_TEXT_COLOR));
+    settings->endGroup();
 
 #ifdef HANDHELD
-	setWindowState(Qt::WindowMaximized);
+    setWindowState(Qt::WindowMaximized);
 #else
-	adjustSize();
+    adjustSize();
 #endif // Q_WS_WINCE_WM
 }
@@ -311,5 +311,5 @@
 bool SettingsDialog::colorChanged() const
 {
-	return _newColor;
+    return _newColor;
 }
 
@@ -320,5 +320,5 @@
 bool SettingsDialog::fontChanged() const
 {
-	return _newFont;
+    return _newFont;
 }
 
@@ -331,5 +331,5 @@
 qint8 SettingsDialog::translucencyChanged() const
 {
-	return _translucency;
+    return _translucency;
 }
 
@@ -338,70 +338,70 @@
 void SettingsDialog::accept()
 {
-	if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
-		if (QMessageBox::question(this, tr("Settings Reset"), tr("Do you really want to <b>reset all application settings to their defaults</b>?"), QMessageBox::RestoreDefaults | QMessageBox::Cancel) == QMessageBox::RestoreDefaults) {
-			_newFont = (font != QFont(DEF_FONT_FACE, DEF_FONT_SIZE));
-			_newColor = (color != DEF_TEXT_COLOR);
-			settings->remove("");
-			settings->setValue("SettingsReset", true);
-			QDialog::accept();
-			QMessageBox::information(this->parentWidget(), tr("Settings Reset"), tr("All settings where successfully reset to their defaults.\nIt is recommended to restart the application now."));
-			return;
-		} else
-			return;
-	}
-	settings->setValue("Autosize", cbAutosize->isChecked());
-	settings->setValue("SaveLastUsed", cbSaveLastUsed->isChecked());
-	settings->setValue("UseNativeDialogs", cbUseNativeDialogs->isChecked());
+    if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
+        if (QMessageBox::question(this, tr("Settings Reset"), tr("Do you really want to <b>reset all application settings to their defaults</b>?"), QMessageBox::RestoreDefaults | QMessageBox::Cancel) == QMessageBox::RestoreDefaults) {
+            _newFont = (font != QFont(DEF_FONT_FACE, DEF_FONT_SIZE));
+            _newColor = (color != DEF_TEXT_COLOR);
+            settings->remove("");
+            settings->setValue("SettingsReset", true);
+            QDialog::accept();
+            QMessageBox::information(this->parentWidget(), tr("Settings Reset"), tr("All settings where successfully reset to their defaults.\nIt is recommended to restart the application now."));
+            return;
+        } else
+            return;
+    }
+    settings->setValue("Autosize", cbAutosize->isChecked());
+    settings->setValue("SaveLastUsed", cbSaveLastUsed->isChecked());
+    settings->setValue("UseNativeDialogs", cbUseNativeDialogs->isChecked());
 #ifdef Q_WS_WIN32
-	if (QtWin::isCompositionEnabled()) {
+    if (QtWin::isCompositionEnabled()) {
 bool old = settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool();
-		if ((!old && cbUseTranslucency->isChecked()) || (old && !cbUseTranslucency->isChecked())) {
-			_translucency = old ? -1 : 1;
-		} else
-			_translucency = 0;
-		settings->setValue("UseTranslucency", cbUseTranslucency->isChecked());
-	}
+        if ((!old && cbUseTranslucency->isChecked()) || (old && !cbUseTranslucency->isChecked())) {
+            _translucency = old ? -1 : 1;
+        } else
+            _translucency = 0;
+        settings->setValue("UseTranslucency", cbUseTranslucency->isChecked());
+    }
 #endif // Q_WS_WIN32
 #ifndef HANDHELD
-	settings->setValue("SavePos", cbSaveState->isChecked());
+    settings->setValue("SavePos", cbSaveState->isChecked());
 #endif // HANDHELD
-	if (cbCheck4Updates != NULL) {
-		settings->beginGroup("Check4Updates");
-		settings->setValue("Enabled", cbCheck4Updates->isChecked());
-		if (cbCheck4Updates->isChecked())
-			settings->setValue("Interval", spinUpdateCheckInterval->value());
-		settings->endGroup();
-	}
-
-	settings->beginGroup("Task");
-	settings->setValue("SymmetricMode", cbSymmetricMode->isChecked());
-	settings->setValue("FractionalAccuracy", spinFractionalAccuracy->value());
-	settings->setValue("RandMin", spinRandMin->value());
-	settings->setValue("RandMax", spinRandMax->value());
-	settings->setValue("FractionalRandom", cbFractionalRandom->isChecked());
-	settings->endGroup();
-
-	settings->beginGroup("Output");
-	settings->setValue("ShowGraph", cbShowGraph->isChecked());
+    if (cbCheck4Updates != NULL) {
+        settings->beginGroup("Check4Updates");
+        settings->setValue("Enabled", cbCheck4Updates->isChecked());
+        if (cbCheck4Updates->isChecked())
+            settings->setValue("Interval", spinUpdateCheckInterval->value());
+        settings->endGroup();
+    }
+
+    settings->beginGroup("Task");
+    settings->setValue("SymmetricMode", cbSymmetricMode->isChecked());
+    settings->setValue("FractionalAccuracy", spinFractionalAccuracy->value());
+    settings->setValue("RandMin", spinRandMin->value());
+    settings->setValue("RandMax", spinRandMax->value());
+    settings->setValue("FractionalRandom", cbFractionalRandom->isChecked());
+    settings->endGroup();
+
+    settings->beginGroup("Output");
+    settings->setValue("ShowGraph", cbShowGraph->isChecked());
 #ifndef QT_NO_PRINTER
-	settings->setValue("HQGraph", cbShowGraph->isChecked() && cbHQGraph->isChecked());
+    settings->setValue("HQGraph", cbShowGraph->isChecked() && cbHQGraph->isChecked());
 #endif
-	if (cbShowGraph->isChecked()) {
-		if (comboGraphImageFormat->currentIndex() >= 0)
-			settings->setValue("GraphImageFormat", comboGraphImageFormat->currentText());
-		else
-			settings->setValue("GraphImageFormat", DEF_GRAPH_IMAGE_FORMAT);
-	}
-	settings->setValue("ShowMatrix", cbShowMatrix->isChecked());
-	settings->setValue("UseShowMatrixLimit", cbShowMatrix->isChecked() && cbCitiesLimit->isChecked());
-	if (cbCitiesLimit->isChecked())
-		settings->setValue("ShowMatrixLimit", spinCitiesLimit->value());
-	settings->setValue("ScrollToEnd", cbScrollToEnd->isChecked());
-	if (_newFont)
-		settings->setValue("Font", font);
-	if (_newColor)
-		settings->setValue("Colors/Text", color);
-	settings->endGroup();
-	QDialog::accept();
+    if (cbShowGraph->isChecked()) {
+        if (comboGraphImageFormat->currentIndex() >= 0)
+            settings->setValue("GraphImageFormat", comboGraphImageFormat->currentText());
+        else
+            settings->setValue("GraphImageFormat", DEF_GRAPH_IMAGE_FORMAT);
+    }
+    settings->setValue("ShowMatrix", cbShowMatrix->isChecked());
+    settings->setValue("UseShowMatrixLimit", cbShowMatrix->isChecked() && cbCitiesLimit->isChecked());
+    if (cbCitiesLimit->isChecked())
+        settings->setValue("ShowMatrixLimit", spinCitiesLimit->value());
+    settings->setValue("ScrollToEnd", cbScrollToEnd->isChecked());
+    if (_newFont)
+        settings->setValue("Font", font);
+    if (_newColor)
+        settings->setValue("Colors/Text", color);
+    settings->endGroup();
+    QDialog::accept();
 }
 
@@ -409,8 +409,8 @@
 {
 QColor color = QColorDialog::getColor(this->color,this);
-	if (color.isValid() && (this->color != color)) {
-		this->color = color;
-		_newColor = true;
-	}
+    if (color.isValid() && (this->color != color)) {
+        this->color = color;
+        _newColor = true;
+    }
 }
 
@@ -419,8 +419,8 @@
 bool ok;
 QFont font = QFontDialog::getFont(&ok,this->font,this);
-	if (ok && (this->font != font)) {
-		this->font = font;
-		_newFont = true;
-	}
+    if (ok && (this->font != font)) {
+        this->font = font;
+        _newFont = true;
+    }
 }
 
@@ -428,37 +428,37 @@
 void SettingsDialog::desktopResized(int screen)
 {
-	if (screen != 0)
-		return;
+    if (screen != 0)
+        return;
 
 QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
-	if (currentGeometry != availableGeometry) {
-		QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-		/*!
-		 * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
-		 *  If \c true, the window gets maximized. If we used \c setGeometry() in this case, the bottom of the
-		 *  window would end up being behind the soft buttons. Is this a bug in Qt or Windows Mobile?
-		 */
-		if ((availableGeometry.top() + availableGeometry.height()) == QApplication::desktop()->screenGeometry().height()) {
-			setWindowState(windowState() | Qt::WindowMaximized);
-		} else {
-			if (windowState() & Qt::WindowMaximized)
-				setWindowState(windowState() ^ Qt::WindowMaximized);
-			setGeometry(availableGeometry);
-		}
-		currentGeometry = availableGeometry;
-		QApplication::restoreOverrideCursor();
-	}
+    if (currentGeometry != availableGeometry) {
+        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+        /*!
+         * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
+         *  If \c true, the window gets maximized. If we used \c setGeometry() in this case, the bottom of the
+         *  window would end up being behind the soft buttons. Is this a bug in Qt or Windows Mobile?
+         */
+        if ((availableGeometry.top() + availableGeometry.height()) == QApplication::desktop()->screenGeometry().height()) {
+            setWindowState(windowState() | Qt::WindowMaximized);
+        } else {
+            if (windowState() & Qt::WindowMaximized)
+                setWindowState(windowState() ^ Qt::WindowMaximized);
+            setGeometry(availableGeometry);
+        }
+        currentGeometry = availableGeometry;
+        QApplication::restoreOverrideCursor();
+    }
 }
 
 void SettingsDialog::showEvent(QShowEvent *ev)
 {
-	desktopResized(0);
-
-	QWidget::showEvent(ev);
+    desktopResized(0);
+
+    QWidget::showEvent(ev);
 }
 #endif // Q_WS_WINCE_WM
 
 void SettingsDialog::spinRandMinValueChanged(int val) {
-	spinRandMax->setMinimum(val);
+    spinRandMax->setMinimum(val);
 }
 
@@ -466,16 +466,16 @@
 bool SettingsDialog::event(QEvent *ev)
 {
-	// Checking for StatusTip event and if tip text is not empty string
-	// setting it as text of the dialog hint label. Otherwise, setting
-	// dialog hint label text to own status tip text.
-	if (ev->type() == QEvent::StatusTip) {
+    // Checking for StatusTip event and if tip text is not empty string
+    // setting it as text of the dialog hint label. Otherwise, setting
+    // dialog hint label text to own status tip text.
+    if (ev->type() == QEvent::StatusTip) {
 QString tip = static_cast<QStatusTipEvent *>(ev)->tip();
-		if (tip.length() != 0)
-			labelHint->setText(tip);
-		else
-			labelHint->setText(labelHint->statusTip());
-		return true;
-	} else
-		return QDialog::event(ev);
+        if (tip.length() != 0)
+            labelHint->setText(tip);
+        else
+            labelHint->setText(labelHint->statusTip());
+        return true;
+    } else
+        return QDialog::event(ev);
 }
 #endif // HANDHELD
Index: /trunk/src/settingsdialog.h
===================================================================
--- /trunk/src/settingsdialog.h	(revision 148)
+++ /trunk/src/settingsdialog.h	(revision 149)
@@ -39,51 +39,51 @@
 class SettingsDialog: public QDialog, Ui::SettingsDialog
 {
-	Q_OBJECT
+    Q_OBJECT
 public:
-	SettingsDialog(QWidget *parent = 0);
-	bool colorChanged() const;
-	bool fontChanged() const;
-	qint8 translucencyChanged() const;
+    SettingsDialog(QWidget *parent = 0);
+    bool colorChanged() const;
+    bool fontChanged() const;
+    qint8 translucencyChanged() const;
 
 private:
-	bool _newFont;
-	bool _newColor;
-	qint8 _translucency;
+    bool _newFont;
+    bool _newColor;
+    qint8 _translucency;
 
-	QColor color;
-	QFont font;
+    QColor color;
+    QFont font;
 
-	QSettings *settings;
-	QHBoxLayout *layoutCitiesLimit;
+    QSettings *settings;
+    QHBoxLayout *layoutCitiesLimit;
 #ifdef Q_WS_WIN32
-	QCheckBox *cbUseTranslucency;
+    QCheckBox *cbUseTranslucency;
 #endif // Q_WS_WIN32
-	QCheckBox *cbCheck4Updates;
-	QSpinBox *spinUpdateCheckInterval;
+    QCheckBox *cbCheck4Updates;
+    QSpinBox *spinUpdateCheckInterval;
 #ifndef QT_NO_PRINTER
-	QCheckBox *cbHQGraph;
+    QCheckBox *cbHQGraph;
 #endif
 #ifdef Q_WS_WINCE_WM
-	QRect currentGeometry;
+    QRect currentGeometry;
 #elif !defined(HANDHELD)
-	QCheckBox *cbSaveState;
-	QLabel *imgIcon;
-	QFrame *lineVertical;
-	QLabel *labelHint;
+    QCheckBox *cbSaveState;
+    QLabel *imgIcon;
+    QFrame *lineVertical;
+    QLabel *labelHint;
 
 #ifndef QT_NO_STATUSTIP
-	bool event(QEvent *ev);
+    bool event(QEvent *ev);
 #endif // QT_NO_STATUSTIP
 #endif // Q_WS_WINCE_WM
 
 private slots:
-	void accept();
-	void buttonColorClicked();
-	void buttonFontClicked();
+    void accept();
+    void buttonColorClicked();
+    void buttonFontClicked();
 #ifdef Q_WS_WINCE_WM
-	void desktopResized(int screen);
-	void showEvent(QShowEvent *ev);
+    void desktopResized(int screen);
+    void showEvent(QShowEvent *ev);
 #endif // Q_WS_WINCE_WM
-	void spinRandMinValueChanged(int val);
+    void spinRandMinValueChanged(int val);
 };
 
Index: /trunk/src/tspmodel.cpp
===================================================================
--- /trunk/src/tspmodel.cpp	(revision 148)
+++ /trunk/src/tspmodel.cpp	(revision 149)
@@ -29,7 +29,7 @@
  */
 CTSPModel::CTSPModel(QObject *parent)
-	: QAbstractTableModel(parent), nCities(0)
-{
-	settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
+    : QAbstractTableModel(parent), nCities(0)
+{
+    settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
 }
 
@@ -41,9 +41,9 @@
 void CTSPModel::clear()
 {
-	for (int r = 0; r < nCities; r++)
-		for (int c = 0; c < nCities; c++)
-			if (r != c)
-				table[r][c] = 0;
-	emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
+    for (int r = 0; r < nCities; r++)
+        for (int c = 0; c < nCities; c++)
+            if (r != c)
+                table[r][c] = 0;
+    emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
 }
 
@@ -58,5 +58,5 @@
 int CTSPModel::columnCount(const QModelIndex &) const
 {
-	return nCities;
+    return nCities;
 }
 
@@ -71,24 +71,24 @@
 QVariant CTSPModel::data(const QModelIndex &index, int role) const
 {
-	if (!index.isValid())
-		return QVariant();
-	if (role == Qt::TextAlignmentRole)
-		return int(Qt::AlignCenter);
-	else if (role == Qt::FontRole) {
+    if (!index.isValid())
+        return QVariant();
+    if (role == Qt::TextAlignmentRole)
+        return int(Qt::AlignCenter);
+    else if (role == Qt::FontRole) {
 QFont font;
-		font.setBold(true);
-		return font;
-	} else if (role == Qt::DisplayRole || role == Qt::EditRole) {
-		if (index.row() < nCities && index.column() < nCities)
-			if (table.at(index.row()).at(index.column()) == INFINITY)
-				return tr(INFSTR);
-			else
-				//! \hack HACK: Converting to string to prevent spinbox in edit mode
-				return QVariant(table.at(index.row()).at(index.column())).toString();
-		else
-			return QVariant();
-	} else if (role == Qt::UserRole)
-		return table[index.row()][index.column()];
-	return QVariant();
+        font.setBold(true);
+        return font;
+    } else if (role == Qt::DisplayRole || role == Qt::EditRole) {
+        if (index.row() < nCities && index.column() < nCities)
+            if (table.at(index.row()).at(index.column()) == INFINITY)
+                return tr(INFSTR);
+            else
+                //! \hack HACK: Converting to string to prevent spinbox in edit mode
+                return QVariant(table.at(index.row()).at(index.column())).toString();
+        else
+            return QVariant();
+    } else if (role == Qt::UserRole)
+        return table[index.row()][index.column()];
+    return QVariant();
 }
 
@@ -101,7 +101,7 @@
 {
 Qt::ItemFlags flags = QAbstractItemModel::flags(index);
-	if (index.row() != index.column())
-		flags |= Qt::ItemIsEditable;
-	return flags;
+    if (index.row() != index.column())
+        flags |= Qt::ItemIsEditable;
+    return flags;
 }
 
@@ -117,11 +117,11 @@
 QVariant CTSPModel::headerData(int section, Qt::Orientation orientation, int role) const
 {
-	if (role == Qt::DisplayRole) {
-		if (orientation == Qt::Vertical)
-			return tr("City %1").arg(section + 1);
-		else
-			return tr("%1").arg(section + 1);
-	}
-	return QVariant();
+    if (role == Qt::DisplayRole) {
+        if (orientation == Qt::Vertical)
+            return tr("City %1").arg(section + 1);
+        else
+            return tr("%1").arg(section + 1);
+    }
+    return QVariant();
 }
 
@@ -135,42 +135,42 @@
 bool CTSPModel::loadTask(const QString &fname)
 {
-	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 QFile f(fname);
-	if (!f.open(QIODevice::ReadOnly)) {
-		QApplication::restoreOverrideCursor();
-		QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), QString(tr("Unable to open task file.\nError: %1")).arg(f.errorString()));
-		QApplication::restoreOverrideCursor();
-		return false;
-	}
+    if (!f.open(QIODevice::ReadOnly)) {
+        QApplication::restoreOverrideCursor();
+        QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), QString(tr("Unable to open task file.\nError: %1")).arg(f.errorString()));
+        QApplication::restoreOverrideCursor();
+        return false;
+    }
 QDataStream ds(&f);
-	ds.setVersion(QDataStream::Qt_4_4);
+    ds.setVersion(QDataStream::Qt_4_4);
 quint32 sig;
-	ds >> sig;
-	if (loadError(ds.status())) {
-		return false;
-	}
-	ds.device()->reset();
-	if (sig == TSPT) {
-		if (!loadTSPT(&ds)) {
-			f.close();
-			return false;
-		}
-	} else if ((sig >> 16) == ZKT) {
-		if (!loadZKT(&ds)) {
-			f.close();
-			return false;
-		}
-	} else {
-		f.close();
-		QApplication::restoreOverrideCursor();
-		QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("Unknown file format or file is corrupted."));
-		QApplication::restoreOverrideCursor();
-		return false;
-	}
-	f.close();
-	QApplication::restoreOverrideCursor();
-	return true;
+    ds >> sig;
+    if (loadError(ds.status())) {
+        return false;
+    }
+    ds.device()->reset();
+    if (sig == TSPT) {
+        if (!loadTSPT(&ds)) {
+            f.close();
+            return false;
+        }
+    } else if ((sig >> 16) == ZKT) {
+        if (!loadZKT(&ds)) {
+            f.close();
+            return false;
+        }
+    } else {
+        f.close();
+        QApplication::restoreOverrideCursor();
+        QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("Unknown file format or file is corrupted."));
+        QApplication::restoreOverrideCursor();
+        return false;
+    }
+    f.close();
+    QApplication::restoreOverrideCursor();
+    return true;
 }
 
@@ -183,5 +183,5 @@
 quint16 CTSPModel::numCities() const
 {
-	return nCities;
+    return nCities;
 }
 
@@ -197,15 +197,15 @@
 int randMin = settings->value("Task/RandMin", DEF_RAND_MIN).toInt();
 int randMax = settings->value("Task/RandMax", DEF_RAND_MAX).toInt();
-	if (settings->value("Task/SymmetricMode", DEF_SYMMETRIC_MODE).toBool()) {
-		for (int r = 0; r < nCities; r++)
-			for (int c = 0; c < r; c++)
-				table[c][r] = table[r][c] = rand(randMin, randMax);
-	} else {
-		for (int r = 0; r < nCities; r++)
-			for (int c = 0; c < nCities; c++)
-				if (r != c)
-					table[r][c] = rand(randMin, randMax);
-	}
-	emit dataChanged(index(0,0), index(nCities - 1, nCities - 1));
+    if (settings->value("Task/SymmetricMode", DEF_SYMMETRIC_MODE).toBool()) {
+        for (int r = 0; r < nCities; r++)
+            for (int c = 0; c < r; c++)
+                table[c][r] = table[r][c] = rand(randMin, randMax);
+    } else {
+        for (int r = 0; r < nCities; r++)
+            for (int c = 0; c < nCities; c++)
+                if (r != c)
+                    table[r][c] = rand(randMin, randMax);
+    }
+    emit dataChanged(index(0,0), index(nCities - 1, nCities - 1));
 }
 
@@ -220,5 +220,5 @@
 int CTSPModel::rowCount(const QModelIndex &) const
 {
-	return nCities;
+    return nCities;
 }
 
@@ -232,82 +232,82 @@
 bool CTSPModel::saveTask(const QString &fname)
 {
-	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 QFile f(fname);
-	if (!f.open(QIODevice::WriteOnly)) {
-		QApplication::restoreOverrideCursor();
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), QString(tr("Unable to create task file.\nError: %1\nMaybe, file is read-only?")).arg(f.errorString()));
-		f.remove();
-		return false;
-	}
+    if (!f.open(QIODevice::WriteOnly)) {
+        QApplication::restoreOverrideCursor();
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), QString(tr("Unable to create task file.\nError: %1\nMaybe, file is read-only?")).arg(f.errorString()));
+        f.remove();
+        return false;
+    }
 QDataStream ds(&f);
-	ds.setVersion(QDataStream::Qt_4_4);
-	if (f.error() != QFile::NoError) {
-		QApplication::restoreOverrideCursor();
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
-		f.close();
-		f.remove();
-		return false;
-	}
-	// File signature
-	ds << TSPT;
-	if (f.error() != QFile::NoError) {
-		QApplication::restoreOverrideCursor();
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
-		f.close();
-		f.remove();
-		return false;
-	}
-	// File version
-	ds << TSPT_VERSION;
-	if (f.error() != QFile::NoError) {
-		QApplication::restoreOverrideCursor();
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
-		f.close();
-		f.remove();
-		return false;
-	}
-	// File metadata version
-	ds << TSPT_META_VERSION;
-	if (f.error() != QFile::NoError) {
-		QApplication::restoreOverrideCursor();
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
-		f.close();
-		f.remove();
-		return false;
-	}
-	// Metadata
-	ds << OSID;
-	if (f.error() != QFile::NoError) {
-		QApplication::restoreOverrideCursor();
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
-		f.close();
-		f.remove();
-		return false;
-	}
-	// Number of cities
-	ds << nCities;
-	if (f.error() != QFile::NoError) {
-		QApplication::restoreOverrideCursor();
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
-		f.close();
-		f.remove();
-		return false;
-	}
-	// Costs
-	for (int r = 0; r < nCities; r++)
-		for (int c = 0; c < nCities; c++)
-			if (r != c) {
-				ds << static_cast<double>(table[r][c]); // We cast to double because double may be float on some platforms and we store double values in file
-				if (f.error() != QFile::NoError) {
-					QApplication::restoreOverrideCursor();
-					QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
-					f.close();
-					f.remove();
-					return false;
-				}
-			}
-	f.close();
-	QApplication::restoreOverrideCursor();
-	return true;
+    ds.setVersion(QDataStream::Qt_4_4);
+    if (f.error() != QFile::NoError) {
+        QApplication::restoreOverrideCursor();
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
+        f.close();
+        f.remove();
+        return false;
+    }
+    // File signature
+    ds << TSPT;
+    if (f.error() != QFile::NoError) {
+        QApplication::restoreOverrideCursor();
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
+        f.close();
+        f.remove();
+        return false;
+    }
+    // File version
+    ds << TSPT_VERSION;
+    if (f.error() != QFile::NoError) {
+        QApplication::restoreOverrideCursor();
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
+        f.close();
+        f.remove();
+        return false;
+    }
+    // File metadata version
+    ds << TSPT_META_VERSION;
+    if (f.error() != QFile::NoError) {
+        QApplication::restoreOverrideCursor();
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
+        f.close();
+        f.remove();
+        return false;
+    }
+    // Metadata
+    ds << OSID;
+    if (f.error() != QFile::NoError) {
+        QApplication::restoreOverrideCursor();
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
+        f.close();
+        f.remove();
+        return false;
+    }
+    // Number of cities
+    ds << nCities;
+    if (f.error() != QFile::NoError) {
+        QApplication::restoreOverrideCursor();
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
+        f.close();
+        f.remove();
+        return false;
+    }
+    // Costs
+    for (int r = 0; r < nCities; r++)
+        for (int c = 0; c < nCities; c++)
+            if (r != c) {
+                ds << static_cast<double>(table[r][c]); // We cast to double because double may be float on some platforms and we store double values in file
+                if (f.error() != QFile::NoError) {
+                    QApplication::restoreOverrideCursor();
+                    QMessageBox::critical(QApplication::activeWindow(), tr("Task Save"), tr("Unable to save task.\nError: %1").arg(f.errorString()));
+                    f.close();
+                    f.remove();
+                    return false;
+                }
+            }
+    f.close();
+    QApplication::restoreOverrideCursor();
+    return true;
 }
 
@@ -323,24 +323,24 @@
 bool CTSPModel::setData(const QModelIndex &index, const QVariant &value, int role)
 {
-	if (!index.isValid())
-		return false;
-	if (role == Qt::EditRole && index.row() != index.column()) {
-		if (value.toString().compare(INFSTR) == 0)
-			table[index.row()][index.column()] = INFINITY;
-		else {
+    if (!index.isValid())
+        return false;
+    if (role == Qt::EditRole && index.row() != index.column()) {
+        if (value.toString().compare(INFSTR) == 0)
+            table[index.row()][index.column()] = INFINITY;
+        else {
 bool ok;
 double tmp = value.toDouble(&ok);
-			if (!ok || tmp < 0)
-				return false;
-			else {
-				table[index.row()][index.column()] = tmp;
-				if (settings->value("Task/SymmetricMode", DEF_SYMMETRIC_MODE).toBool())
-					table[index.column()][index.row()] = tmp;
-			}
-		}
-		emit dataChanged(index,index);
-		return true;
-	}
-	return false;
+            if (!ok || tmp < 0)
+                return false;
+            else {
+                table[index.row()][index.column()] = tmp;
+                if (settings->value("Task/SymmetricMode", DEF_SYMMETRIC_MODE).toBool())
+                    table[index.column()][index.row()] = tmp;
+            }
+        }
+        emit dataChanged(index,index);
+        return true;
+    }
+    return false;
 }
 
@@ -353,16 +353,16 @@
 void CTSPModel::setNumCities(int n)
 {
-	if (n == nCities)
-		return;
-	emit layoutAboutToBeChanged();
-	table.resize(n);
-	for (int k = 0; k < n; k++) {
-		table[k].resize(n);
-	}
-	if (n > nCities)
-		for (int k = nCities; k < n; k++)
-			table[k][k] = INFINITY;
-	nCities = n;
-	emit layoutChanged();
+    if (n == nCities)
+        return;
+    emit layoutAboutToBeChanged();
+    table.resize(n);
+    for (int k = 0; k < n; k++) {
+        table[k].resize(n);
+    }
+    if (n > nCities)
+        for (int k = nCities; k < n; k++)
+            table[k][k] = INFINITY;
+    nCities = n;
+    emit layoutChanged();
 }
 
@@ -372,130 +372,130 @@
 {
 QString err;
-	if (status == QDataStream::Ok)
-		return false;
-	else if (status == QDataStream::ReadPastEnd)
-		err = tr("Unexpected end of file.");
-	else if (status == QDataStream::ReadCorruptData)
-		err = tr("Corrupt data read. File possibly corrupted.");
-	else
-		err = tr("Unknown error.");
-	QApplication::restoreOverrideCursor();
-	QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-	QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + err);
-	QApplication::restoreOverrideCursor();
-	return true;
+    if (status == QDataStream::Ok)
+        return false;
+    else if (status == QDataStream::ReadPastEnd)
+        err = tr("Unexpected end of file.");
+    else if (status == QDataStream::ReadCorruptData)
+        err = tr("Corrupt data read. File possibly corrupted.");
+    else
+        err = tr("Unknown error.");
+    QApplication::restoreOverrideCursor();
+    QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+    QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + err);
+    QApplication::restoreOverrideCursor();
+    return true;
 }
 
 bool CTSPModel::loadTSPT(QDataStream *ds)
 {
-	// Skipping signature
-	ds->skipRawData(sizeof(TSPT));
-	if (loadError(ds->status()))
-		return false;
-	// File version
+    // Skipping signature
+    ds->skipRawData(sizeof(TSPT));
+    if (loadError(ds->status()))
+        return false;
+    // File version
 quint8 version;
-	*ds >> version;
-	if (loadError(ds->status()))
-		return false;
-	if (version > TSPT_VERSION) {
-		QApplication::restoreOverrideCursor();
-		QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("File version is newer than application supports.\nPlease, try to update application."));
-		QApplication::restoreOverrideCursor();
-		return false;
-	}
-	// Skipping metadata
-	ds->skipRawData(TSPT_META_SIZE);
-	if (loadError(ds->status()))
-		return false;
-	// Number of cities
+    *ds >> version;
+    if (loadError(ds->status()))
+        return false;
+    if (version > TSPT_VERSION) {
+        QApplication::restoreOverrideCursor();
+        QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("File version is newer than application supports.\nPlease, try to update application."));
+        QApplication::restoreOverrideCursor();
+        return false;
+    }
+    // Skipping metadata
+    ds->skipRawData(TSPT_META_SIZE);
+    if (loadError(ds->status()))
+        return false;
+    // Number of cities
 quint16 size;
-	*ds >> size;
-	if (loadError(ds->status()))
-		return false;
-	if ((size < 3) || (size > MAX_NUM_CITIES)) {
-		QApplication::restoreOverrideCursor();
-		QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("Unexpected data read.\nFile is possibly corrupted."));
-		QApplication::restoreOverrideCursor();
-		return false;
-	}
-	if (nCities != size) {
-		setNumCities(size);
-		emit numCitiesChanged(size);
-	}
+    *ds >> size;
+    if (loadError(ds->status()))
+        return false;
+    if ((size < 3) || (size > MAX_NUM_CITIES)) {
+        QApplication::restoreOverrideCursor();
+        QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("Unexpected data read.\nFile is possibly corrupted."));
+        QApplication::restoreOverrideCursor();
+        return false;
+    }
+    if (nCities != size) {
+        setNumCities(size);
+        emit numCitiesChanged(size);
+    }
 
 double x; // We need this as double may be float on some platforms and we store double values in file
-	// Travel costs
-	for (int r = 0; r < size; r++)
-		for (int c = 0; c < size; c++)
-			if (r != c) {
-				*ds >> x;
-				table[r][c] = x;
-				if (loadError(ds->status())) {
-					clear();
-					return false;
-				}
-			}
-	emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
-	QApplication::restoreOverrideCursor();
-	return true;
+    // Travel costs
+    for (int r = 0; r < size; r++)
+        for (int c = 0; c < size; c++)
+            if (r != c) {
+                *ds >> x;
+                table[r][c] = x;
+                if (loadError(ds->status())) {
+                    clear();
+                    return false;
+                }
+            }
+    emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
+    QApplication::restoreOverrideCursor();
+    return true;
 }
 
 bool CTSPModel::loadZKT(QDataStream *ds)
 {
-	// Skipping signature
-	ds->skipRawData(sizeof(ZKT));
-	if (loadError(ds->status()))
-		return false;
-	// File version
+    // Skipping signature
+    ds->skipRawData(sizeof(ZKT));
+    if (loadError(ds->status()))
+        return false;
+    // File version
 quint16 version;
-	ds->readRawData(reinterpret_cast<char *>(&version),2);
-	if (loadError(ds->status()))
-		return false;
-	if (version > ZKT_VERSION) {
-		QApplication::restoreOverrideCursor();
-		QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("File version is newer than application supports.\nPlease, try to update application."));
-		QApplication::restoreOverrideCursor();
-		return false;
-	}
-	// Number of cities
+    ds->readRawData(reinterpret_cast<char *>(&version),2);
+    if (loadError(ds->status()))
+        return false;
+    if (version > ZKT_VERSION) {
+        QApplication::restoreOverrideCursor();
+        QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("File version is newer than application supports.\nPlease, try to update application."));
+        QApplication::restoreOverrideCursor();
+        return false;
+    }
+    // Number of cities
 quint8 size;
-	ds->readRawData(reinterpret_cast<char *>(&size),1);
-	if (loadError(ds->status()))
-		return false;
-	if ((size < 3) || (size > 5)) {
-		QApplication::restoreOverrideCursor();
-		QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-		QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("Unexpected data read.\nFile is possibly corrupted."));
-		QApplication::restoreOverrideCursor();
-		return false;
-	}
-	if (nCities != size) {
-		setNumCities(size);
-		emit numCitiesChanged(size);
-	}
-	// Travel costs
+    ds->readRawData(reinterpret_cast<char *>(&size),1);
+    if (loadError(ds->status()))
+        return false;
+    if ((size < 3) || (size > 5)) {
+        QApplication::restoreOverrideCursor();
+        QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
+        QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("Unexpected data read.\nFile is possibly corrupted."));
+        QApplication::restoreOverrideCursor();
+        return false;
+    }
+    if (nCities != size) {
+        setNumCities(size);
+        emit numCitiesChanged(size);
+    }
+    // Travel costs
 double val;
-	for (int r = 0; r < 5; r++)
-		for (int c = 0; c < 5; c++)
-			if ((r != c) && (r < size) && (c < size)) {
-				ds->readRawData(reinterpret_cast<char *>(&val),8);
-				if (loadError(ds->status())) {
-					clear();
-					return false;
-				}
-				table[r][c] = val;
-			} else {
-				ds->skipRawData(8);
-				if (loadError(ds->status())) {
-					clear();
-					return false;
-				}
-			}
-	emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
-	QApplication::restoreOverrideCursor();
-	return true;
+    for (int r = 0; r < 5; r++)
+        for (int c = 0; c < 5; c++)
+            if ((r != c) && (r < size) && (c < size)) {
+                ds->readRawData(reinterpret_cast<char *>(&val),8);
+                if (loadError(ds->status())) {
+                    clear();
+                    return false;
+                }
+                table[r][c] = val;
+            } else {
+                ds->skipRawData(8);
+                if (loadError(ds->status())) {
+                    clear();
+                    return false;
+                }
+            }
+    emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
+    QApplication::restoreOverrideCursor();
+    return true;
 }
 
@@ -503,9 +503,9 @@
 {
 double r;
-	if (settings->value("Task/FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool()) {
+    if (settings->value("Task/FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool()) {
 double x = qPow(10, settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
-		r = (double)qRound((double)qrand() / RAND_MAX * (max - min) * x) / x;
-	} else
-		r = qRound((double)qrand() / RAND_MAX * (max - min));
-	return min + r;
-}
+        r = (double)qRound((double)qrand() / RAND_MAX * (max - min) * x) / x;
+    } else
+        r = qRound((double)qrand() / RAND_MAX * (max - min));
+    return min + r;
+}
Index: /trunk/src/tspmodel.h
===================================================================
--- /trunk/src/tspmodel.h	(revision 148)
+++ /trunk/src/tspmodel.h	(revision 149)
@@ -37,37 +37,37 @@
 class CTSPModel: public QAbstractTableModel
 {
-	Q_OBJECT
+    Q_OBJECT
 
 public:
-	CTSPModel(QObject *parent = 0);
-	void clear();
-	int columnCount(const QModelIndex &parent = QModelIndex()) const;
-	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-	Qt::ItemFlags flags(const QModelIndex &index) const;
-	QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
-	bool loadTask(const QString &fname);
-	quint16 numCities() const;
-	void randomize();
-	int rowCount(const QModelIndex &parent = QModelIndex()) const;
-	bool saveTask(const QString &fname);
-	bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
-	void setNumCities(int n);
+    CTSPModel(QObject *parent = 0);
+    void clear();
+    int columnCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+    Qt::ItemFlags flags(const QModelIndex &index) const;
+    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
+    bool loadTask(const QString &fname);
+    quint16 numCities() const;
+    void randomize();
+    int rowCount(const QModelIndex &parent = QModelIndex()) const;
+    bool saveTask(const QString &fname);
+    bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
+    void setNumCities(int n);
 
 signals:
-	/*!
-	 * \brief This signal is emitted whenever the number of cities in the task changes.
-	 *
-	 * \sa setNumCities()
-	 */
-	void numCitiesChanged(int);
+    /*!
+     * \brief This signal is emitted whenever the number of cities in the task changes.
+     *
+     * \sa setNumCities()
+     */
+    void numCitiesChanged(int);
 
 private:
-	QSettings *settings;
-	QVector<QVector<double> > table;
-	quint16 nCities;
-	bool loadError(QDataStream::Status);
-	bool loadTSPT(QDataStream *);
-	bool loadZKT(QDataStream *);
-	double rand(int, int) const;
+    QSettings *settings;
+    QVector<QVector<double> > table;
+    quint16 nCities;
+    bool loadError(QDataStream::Status);
+    bool loadTSPT(QDataStream *);
+    bool loadZKT(QDataStream *);
+    double rand(int, int) const;
 };
 
Index: /trunk/src/tspsolver.cpp
===================================================================
--- /trunk/src/tspsolver.cpp	(revision 148)
+++ /trunk/src/tspsolver.cpp	(revision 149)
@@ -35,5 +35,5 @@
 QString CTSPSolver::getVersionId()
 {
-	return QString("$Id$");
+    return QString("$Id$");
 }
 
@@ -43,5 +43,5 @@
  */
 CTSPSolver::CTSPSolver(QObject *parent)
-	: QObject(parent), cc(true), nCities(0), total(0), root(NULL) {}
+    : QObject(parent), cc(true), nCities(0), total(0), root(NULL) {}
 
 /*!
@@ -55,8 +55,8 @@
 void CTSPSolver::cleanup(bool processEvents)
 {
-	route.clear();
-	mayNotBeOptimal = false;
-	if (root != NULL)
-		deleteTree(root, processEvents);
+    route.clear();
+    mayNotBeOptimal = false;
+    if (root != NULL)
+        deleteTree(root, processEvents);
 }
 
@@ -72,17 +72,17 @@
 QString CTSPSolver::getSortedPath(const QString &city, const QString &separator) const
 {
-	if (!root || route.isEmpty() || (route.size() != nCities))
-		return QString();
+    if (!root || route.isEmpty() || (route.size() != nCities))
+        return QString();
 
 int i = 0; // We start from City 1
 QStringList path;
-	path << city.arg(1);
-	while ((i = route[i]) != 0) {
-		path << city.arg(i + 1);
-	}
-	// And finish in City 1, too
-	path << city.arg(1);
-
-	return path.join(separator);
+    path << city.arg(1);
+    while ((i = route[i]) != 0) {
+        path << city.arg(i + 1);
+    }
+    // And finish in City 1, too
+    path << city.arg(1);
+
+    return path.join(separator);
 }
 
@@ -94,5 +94,5 @@
 int CTSPSolver::getTotalSteps() const
 {
-	return total;
+    return total;
 }
 
@@ -106,5 +106,5 @@
 bool CTSPSolver::isOptimal() const
 {
-	return !mayNotBeOptimal;
+    return !mayNotBeOptimal;
 }
 
@@ -121,5 +121,5 @@
 void CTSPSolver::setCleanupOnCancel(bool enable)
 {
-	cc = enable;
+    cc = enable;
 }
 
@@ -134,25 +134,25 @@
 SStep *CTSPSolver::solve(int numCities, const TMatrix &task)
 {
-	if (numCities < 3)
-		return NULL;
+    if (numCities < 3)
+        return NULL;
 
 QMutexLocker locker(&mutex);
-	cleanup();
-	canceled = false;
-	locker.unlock();
-
-	nCities = numCities;
+    cleanup();
+    canceled = false;
+    locker.unlock();
+
+    nCities = numCities;
 
 SStep *step = new SStep();
-	step->matrix = task;
-	// We need to distinguish the values forbidden by the user
-	// from the values forbidden by the algorithm.
-	// So we replace user's infinities by the maximum available double value.
-	normalize(step->matrix);
+    step->matrix = task;
+    // We need to distinguish the values forbidden by the user
+    // from the values forbidden by the algorithm.
+    // So we replace user's infinities by the maximum available double value.
+    normalize(step->matrix);
 #ifdef DEBUG
-	qDebug() << step->matrix;
+    qDebug() << step->matrix;
 #endif // DEBUG
-	step->price = align(step->matrix);
-	root = step;
+    step->price = align(step->matrix);
+    root = step;
 
 SStep *left, *right;
@@ -160,87 +160,87 @@
 bool firstStep = true;
 double check = INFINITY;
-	total = 0;
-	while (route.size() < nCities) {
-		step->alts = findCandidate(step->matrix,nRow,nCol);
-
-		while (hasSubCycles(nRow,nCol)) {
+    total = 0;
+    while (route.size() < nCities) {
+        step->alts = findCandidate(step->matrix,nRow,nCol);
+
+        while (hasSubCycles(nRow,nCol)) {
 #ifdef DEBUG
-			qDebug() << "Forbidden: (" << nRow << ";" << nCol << ")";
+            qDebug() << "Forbidden: (" << nRow << ";" << nCol << ")";
 #endif // DEBUG
-			step->matrix[nRow][nCol] = INFINITY;
-			step->price += align(step->matrix);
-			step->alts = findCandidate(step->matrix,nRow,nCol);
-		}
+            step->matrix[nRow][nCol] = INFINITY;
+            step->price += align(step->matrix);
+            step->alts = findCandidate(step->matrix,nRow,nCol);
+        }
 
 #ifdef DEBUG
-		qDebug() /*<< step->matrix*/ << "Selected: (" << nRow << ";" << nCol << ")";
-		qDebug() << "Alternate:" << step->alts;
-		qDebug() << "Step price:" << step->price << endl;
+        qDebug() /*<< step->matrix*/ << "Selected: (" << nRow << ";" << nCol << ")";
+        qDebug() << "Alternate:" << step->alts;
+        qDebug() << "Step price:" << step->price << endl;
 #endif // DEBUG
 
-		locker.relock();
-		if ((nRow == -1) || (nCol == -1) || canceled) {
-			if (canceled && cc)
-				cleanup();
-			return NULL;
-		}
-		locker.unlock();
-
-		// Route with (nRow,nCol) path
-		right = new SStep();
-		right->pNode = step;
-		right->matrix = step->matrix;
-		for (int k = 0; k < nCities; k++) {
-			if (k != nCol)
-				right->matrix[nRow][k] = INFINITY;
-			if (k != nRow)
-				right->matrix[k][nCol] = INFINITY;
-		}
-		right->price = step->price + align(right->matrix);
-		// Forbid the selected route to exclude its reuse in next steps.
-		right->matrix[nCol][nRow] = INFINITY;
-		right->matrix[nRow][nCol] = INFINITY;
-
-		// Route without (nRow,nCol) path
-		left = new SStep();
-		left->pNode = step;
-		left->matrix = step->matrix;
-		left->matrix[nRow][nCol] = INFINITY;
-		left->price = step->price + align(left->matrix);
-
-		step->candidate.nRow = nRow;
-		step->candidate.nCol = nCol;
-		step->plNode = left;
-		step->prNode = right;
-
-		// This matrix is not used anymore. Restoring infinities back.
-		denormalize(step->matrix);
-
-		if (right->price <= left->price) {
-			// Route with (nRow,nCol) path is cheaper
-			step->next = SStep::RightBranch;
-			step = right;
-			route[nRow] = nCol;
-			emit routePartFound(route.size());
-			if (firstStep) {
-				check = left->price;
-				firstStep = false;
-			}
-		} else {
-			// Route without (nRow,nCol) path is cheaper
-			step->next = SStep::LeftBranch;
-			step = left;
-			QCoreApplication::processEvents();
-			if (firstStep) {
-				check = right->price;
-				firstStep = false;
-			}
-		}
-		total++;
-	}
-
-	mayNotBeOptimal = (check < step->price);
-
-	return root;
+        locker.relock();
+        if ((nRow == -1) || (nCol == -1) || canceled) {
+            if (canceled && cc)
+                cleanup();
+            return NULL;
+        }
+        locker.unlock();
+
+        // Route with (nRow,nCol) path
+        right = new SStep();
+        right->pNode = step;
+        right->matrix = step->matrix;
+        for (int k = 0; k < nCities; k++) {
+            if (k != nCol)
+                right->matrix[nRow][k] = INFINITY;
+            if (k != nRow)
+                right->matrix[k][nCol] = INFINITY;
+        }
+        right->price = step->price + align(right->matrix);
+        // Forbid the selected route to exclude its reuse in next steps.
+        right->matrix[nCol][nRow] = INFINITY;
+        right->matrix[nRow][nCol] = INFINITY;
+
+        // Route without (nRow,nCol) path
+        left = new SStep();
+        left->pNode = step;
+        left->matrix = step->matrix;
+        left->matrix[nRow][nCol] = INFINITY;
+        left->price = step->price + align(left->matrix);
+
+        step->candidate.nRow = nRow;
+        step->candidate.nCol = nCol;
+        step->plNode = left;
+        step->prNode = right;
+
+        // This matrix is not used anymore. Restoring infinities back.
+        denormalize(step->matrix);
+
+        if (right->price <= left->price) {
+            // Route with (nRow,nCol) path is cheaper
+            step->next = SStep::RightBranch;
+            step = right;
+            route[nRow] = nCol;
+            emit routePartFound(route.size());
+            if (firstStep) {
+                check = left->price;
+                firstStep = false;
+            }
+        } else {
+            // Route without (nRow,nCol) path is cheaper
+            step->next = SStep::LeftBranch;
+            step = left;
+            QCoreApplication::processEvents();
+            if (firstStep) {
+                check = right->price;
+                firstStep = false;
+            }
+        }
+        total++;
+    }
+
+    mayNotBeOptimal = (check < step->price);
+
+    return root;
 }
 
@@ -252,5 +252,5 @@
 {
 QMutexLocker locker(&mutex);
-	return canceled;
+    return canceled;
 }
 
@@ -261,11 +261,11 @@
 {
 QMutexLocker locker(&mutex);
-	canceled = true;
+    canceled = true;
 }
 
 CTSPSolver::~CTSPSolver()
 {
-	if (root != NULL)
-		deleteTree(root);
+    if (root != NULL)
+        deleteTree(root);
 }
 
@@ -276,90 +276,90 @@
 double r = 0;
 double min;
-	for (int k = 0; k < nCities; k++) {
-		min = findMinInRow(k,matrix);
-		if (min > 0) {
-			r += min;
-			if (min < MAX_DOUBLE)
-				subRow(matrix,k,min);
-		}
-	}
-	for (int k = 0; k < nCities; k++) {
-		min = findMinInCol(k,matrix);
-		if (min > 0) {
-			r += min;
-			if (min < MAX_DOUBLE)
-				subCol(matrix,k,min);
-		}
-	}
-	return (r != MAX_DOUBLE) ? r : INFINITY;
+    for (int k = 0; k < nCities; k++) {
+        min = findMinInRow(k,matrix);
+        if (min > 0) {
+            r += min;
+            if (min < MAX_DOUBLE)
+                subRow(matrix,k,min);
+        }
+    }
+    for (int k = 0; k < nCities; k++) {
+        min = findMinInCol(k,matrix);
+        if (min > 0) {
+            r += min;
+            if (min < MAX_DOUBLE)
+                subCol(matrix,k,min);
+        }
+    }
+    return (r != MAX_DOUBLE) ? r : INFINITY;
 }
 
 void CTSPSolver::deleteTree(SStep *&root, bool processEvents)
 {
-	if (root == NULL)
-		return;
+    if (root == NULL)
+        return;
 SStep *step = root;
 SStep *parent;
-	forever {
-		if (processEvents)
-			QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-		if (step->plNode != NULL) {
-			// We have left child node - going inside it
-			step = step->plNode;
-			step->pNode->plNode = NULL;
-			continue;
-		} else if (step->prNode != NULL) {
-			// We have right child node - going inside it
-			step = step->prNode;
-			step->pNode->prNode = NULL;
-			continue;
-		} else {
-			// We have no child nodes. Deleting the current one.
-			parent = step->pNode;
-			delete step;
-			if (parent != NULL) {
-				// Going back to the parent node.
-				step = parent;
-			} else {
-				// We came back to the root node. Finishing.
-				root = NULL;
-				break;
-			}
-		}
-	}
+    forever {
+        if (processEvents)
+            QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+        if (step->plNode != NULL) {
+            // We have left child node - going inside it
+            step = step->plNode;
+            step->pNode->plNode = NULL;
+            continue;
+        } else if (step->prNode != NULL) {
+            // We have right child node - going inside it
+            step = step->prNode;
+            step->pNode->prNode = NULL;
+            continue;
+        } else {
+            // We have no child nodes. Deleting the current one.
+            parent = step->pNode;
+            delete step;
+            if (parent != NULL) {
+                // Going back to the parent node.
+                step = parent;
+            } else {
+                // We came back to the root node. Finishing.
+                root = NULL;
+                break;
+            }
+        }
+    }
 }
 
 void CTSPSolver::denormalize(TMatrix &matrix) const
 {
-	for (int r = 0; r < nCities; r++)
-		for (int c = 0; c < nCities; c++)
-			if ((r != c) && (matrix.at(r).at(c) == MAX_DOUBLE))
-				matrix[r][c] = INFINITY;
+    for (int r = 0; r < nCities; r++)
+        for (int c = 0; c < nCities; c++)
+            if ((r != c) && (matrix.at(r).at(c) == MAX_DOUBLE))
+                matrix[r][c] = INFINITY;
 }
 
 QList<SStep::SCandidate> CTSPSolver::findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const
 {
-	nRow = -1;
-	nCol = -1;
+    nRow = -1;
+    nCol = -1;
 QList<SStep::SCandidate> alts;
 SStep::SCandidate cand;
 double h = -1;
 double sum;
-	for (int r = 0; r < nCities; r++)
-		for (int c = 0; c < nCities; c++)
-			if (matrix.at(r).at(c) == 0) {
-				sum = findMinInRow(r,matrix,c) + findMinInCol(c,matrix,r);
-				if (sum > h) {
-					h = sum;
-					nRow = r;
-					nCol = c;
-					alts.clear();
-				} else if ((sum == h) && !hasSubCycles(r,c)) {
-					cand.nRow = r;
-					cand.nCol = c;
-					alts.append(cand);
-				}
-			}
-	return alts;
+    for (int r = 0; r < nCities; r++)
+        for (int c = 0; c < nCities; c++)
+            if (matrix.at(r).at(c) == 0) {
+                sum = findMinInRow(r,matrix,c) + findMinInCol(c,matrix,r);
+                if (sum > h) {
+                    h = sum;
+                    nRow = r;
+                    nCol = c;
+                    alts.clear();
+                } else if ((sum == h) && !hasSubCycles(r,c)) {
+                    cand.nRow = r;
+                    cand.nCol = c;
+                    alts.append(cand);
+                }
+            }
+    return alts;
 }
 
@@ -367,8 +367,8 @@
 {
 double min = INFINITY;
-	for (int k = 0; k < nCities; k++)
-		if ((k != exr) && (min > matrix.at(k).at(nCol)))
-			min = matrix.at(k).at(nCol);
-	return (min == INFINITY) ? 0 : min;
+    for (int k = 0; k < nCities; k++)
+        if ((k != exr) && (min > matrix.at(k).at(nCol)))
+            min = matrix.at(k).at(nCol);
+    return (min == INFINITY) ? 0 : min;
 }
 
@@ -376,45 +376,45 @@
 {
 double min = INFINITY;
-	for (int k = 0; k < nCities; k++) {
-		if (((k != exc)) && (min > matrix.at(nRow).at(k)))
-			min = matrix.at(nRow).at(k);
-	}
-	return (min == INFINITY) ? 0 : min;
+    for (int k = 0; k < nCities; k++) {
+        if (((k != exc)) && (min > matrix.at(nRow).at(k)))
+            min = matrix.at(nRow).at(k);
+    }
+    return (min == INFINITY) ? 0 : min;
 }
 
 bool CTSPSolver::hasSubCycles(int nRow, int nCol) const
 {
-	if ((nRow < 0) || (nCol < 0) || route.isEmpty() || !(route.size() < nCities - 1) || !route.contains(nCol))
-		return false;
+    if ((nRow < 0) || (nCol < 0) || route.isEmpty() || !(route.size() < nCities - 1) || !route.contains(nCol))
+        return false;
 int i = nCol;
-	forever {
-		if ((i = route.value(i)) == nRow)
-			return true;
-		if (!route.contains(i))
-			return false;
-	}
-	return false;
+    forever {
+        if ((i = route.value(i)) == nRow)
+            return true;
+        if (!route.contains(i))
+            return false;
+    }
+    return false;
 }
 
 void CTSPSolver::normalize(TMatrix &matrix) const
 {
-	for (int r = 0; r < nCities; r++)
-		for (int c = 0; c < nCities; c++)
-			if ((r != c) && (matrix.at(r).at(c) == INFINITY))
-				matrix[r][c] = MAX_DOUBLE;
+    for (int r = 0; r < nCities; r++)
+        for (int c = 0; c < nCities; c++)
+            if ((r != c) && (matrix.at(r).at(c) == INFINITY))
+                matrix[r][c] = MAX_DOUBLE;
 }
 
 void CTSPSolver::subCol(TMatrix &matrix, int nCol, double val)
 {
-	for (int k = 0; k < nCities; k++)
-		if (k != nCol)
-			matrix[k][nCol] -= val;
+    for (int k = 0; k < nCities; k++)
+        if (k != nCol)
+            matrix[k][nCol] -= val;
 }
 
 void CTSPSolver::subRow(TMatrix &matrix, int nRow, double val)
 {
-	for (int k = 0; k < nCities; k++)
-		if (k != nRow)
-			matrix[nRow][k] -= val;
+    for (int k = 0; k < nCities; k++)
+        if (k != nRow)
+            matrix[nRow][k] -= val;
 }
 
@@ -424,16 +424,16 @@
 QDebug operator<<(QDebug dbg, const TSPSolver::TMatrix &matrix)
 {
-	for (int r = 0; r < matrix.count(); r++) {
-		for (int c = 0; c < matrix.at(r).count(); c++)
-			dbg.space() << QString::number(matrix.at(r).at(c)).leftJustified(5);
-		dbg << endl;
-	}
-	return dbg;
+    for (int r = 0; r < matrix.count(); r++) {
+        for (int c = 0; c < matrix.at(r).count(); c++)
+            dbg.space() << QString::number(matrix.at(r).at(c)).leftJustified(5);
+        dbg << endl;
+    }
+    return dbg;
 }
 
 QDebug operator<<(QDebug dbg, const TSPSolver::SStep::SCandidate &cand)
 {
-	dbg.nospace() << "(" << cand.nRow << ";" << cand.nCol << ")";
-	return dbg;
+    dbg.nospace() << "(" << cand.nRow << ";" << cand.nCol << ")";
+    return dbg;
 }
 #endif // DEBUG
Index: /trunk/src/tspsolver.h
===================================================================
--- /trunk/src/tspsolver.h	(revision 148)
+++ /trunk/src/tspsolver.h	(revision 149)
@@ -40,5 +40,5 @@
  */
 #ifdef INFINITY
-	#undef INFINITY
+#   undef INFINITY
 #endif
 #define INFINITY std::numeric_limits<double>::infinity()
@@ -60,42 +60,42 @@
  */
 struct SStep {
-	//! A structure that represents a candidate for branching
-	struct SCandidate {
-		int nRow; //!< A zero-based row number of the candidate
-		int nCol; //!< A zero-based column number of the candidate
+    //! A structure that represents a candidate for branching
+    struct SCandidate {
+        int nRow; //!< A zero-based row number of the candidate
+        int nCol; //!< A zero-based column number of the candidate
 
-		//! Assigns default values
-		SCandidate() {
-			nCol = nRow = -1;
-		}
-		//! An operator == implementation
-		bool operator ==(const SCandidate &cand) const {
-			return ((cand.nRow == nRow) && (cand.nCol == nCol));
-		}
-	};
+        //! Assigns default values
+        SCandidate() {
+            nCol = nRow = -1;
+        }
+        //! An operator == implementation
+        bool operator ==(const SCandidate &cand) const {
+            return ((cand.nRow == nRow) && (cand.nCol == nCol));
+        }
+    };
 
-	//! An enum that describes possible selection of the next step
-	enum NextStep {
-		NoNextStep, //!< No next step (end of solution)
-		LeftBranch, //!< Left branch was selected for the next step
-		RightBranch //!< Right branch was selected for the next step
-	};
+    //! An enum that describes possible selection of the next step
+    enum NextStep {
+        NoNextStep, //!< No next step (end of solution)
+        LeftBranch, //!< Left branch was selected for the next step
+        RightBranch //!< Right branch was selected for the next step
+    };
 
-	TMatrix matrix; //!< This step's matrix
-	double price; //!< The price of travel to this step
+    TMatrix matrix; //!< This step's matrix
+    double price; //!< The price of travel to this step
 
-	SCandidate candidate; //!< A candiadate for branching in the current step
-	QList<SCandidate> alts; //!< A list of alternative branching candidates
-	SStep *pNode; //!< Pointer to the parent step
-	SStep *plNode; //!< Pointer to the left branch step
-	SStep *prNode; //!< Pointer to the right branch step
-	NextStep next; //!< Indicates what branch was selected for the next step
+    SCandidate candidate; //!< A candiadate for branching in the current step
+    QList<SCandidate> alts; //!< A list of alternative branching candidates
+    SStep *pNode; //!< Pointer to the parent step
+    SStep *plNode; //!< Pointer to the left branch step
+    SStep *prNode; //!< Pointer to the right branch step
+    NextStep next; //!< Indicates what branch was selected for the next step
 
-	//! Assigns default values
-	SStep() {
-		price = -1;
-		pNode = plNode = prNode = NULL;
-		next = NoNextStep;
-	}
+    //! Assigns default values
+    SStep() {
+        price = -1;
+        pNode = plNode = prNode = NULL;
+        next = NoNextStep;
+    }
 };
 
@@ -106,47 +106,47 @@
 class CTSPSolver: public QObject
 {
-	Q_OBJECT
+    Q_OBJECT
 
 public:
-	static QString getVersionId();
+    static QString getVersionId();
 
-	CTSPSolver(QObject *parent = NULL);
-	void cleanup(bool processEvents = false);
-	QString getSortedPath(const QString &city, const QString &separator = QString(" -> ")) const;
-	int getTotalSteps() const;
-	bool isOptimal() const;
-	void setCleanupOnCancel(bool enable = true);
-	SStep *solve(int numCities, const TMatrix &task);
-	bool wasCanceled() const;
-	~CTSPSolver();
+    CTSPSolver(QObject *parent = NULL);
+    void cleanup(bool processEvents = false);
+    QString getSortedPath(const QString &city, const QString &separator = QString(" -> ")) const;
+    int getTotalSteps() const;
+    bool isOptimal() const;
+    void setCleanupOnCancel(bool enable = true);
+    SStep *solve(int numCities, const TMatrix &task);
+    bool wasCanceled() const;
+    ~CTSPSolver();
 
 public slots:
-	void cancel();
+    void cancel();
 
 signals:
-	/*!
-	 * \brief This signal is emitted once every time a part of the route is found.
-	 * \param n Indicates the number of the route parts found.
-	 */
-	void routePartFound(int n);
+    /*!
+     * \brief This signal is emitted once every time a part of the route is found.
+     * \param n Indicates the number of the route parts found.
+     */
+    void routePartFound(int n);
 
 private:
-	bool mayNotBeOptimal, canceled, cc;
-	int nCities, total;
-	SStep *root;
-	QHash<int,int> route;
-	mutable QMutex mutex;
+    bool mayNotBeOptimal, canceled, cc;
+    int nCities, total;
+    SStep *root;
+    QHash<int,int> route;
+    mutable QMutex mutex;
 
-	double align(TMatrix &matrix);
-	void deleteTree(SStep *&root, bool processEvents = false);
-	void denormalize(TMatrix &matrix) const;
-	QList<SStep::SCandidate> findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const;
-	double findMinInCol(int nCol, const TMatrix &matrix, int exr = -1) const;
-	double findMinInRow(int nRow, const TMatrix &matrix, int exc = -1) const;
-	void finishRoute();
-	bool hasSubCycles(int nRow, int nCol) const;
-	void normalize(TMatrix &matrix) const;
-	void subCol(TMatrix &matrix, int nCol, double val);
-	void subRow(TMatrix &matrix, int nRow, double val);
+    double align(TMatrix &matrix);
+    void deleteTree(SStep *&root, bool processEvents = false);
+    void denormalize(TMatrix &matrix) const;
+    QList<SStep::SCandidate> findCandidate(const TMatrix &matrix, int &nRow, int &nCol) const;
+    double findMinInCol(int nCol, const TMatrix &matrix, int exr = -1) const;
+    double findMinInRow(int nRow, const TMatrix &matrix, int exc = -1) const;
+    void finishRoute();
+    bool hasSubCycles(int nRow, int nCol) const;
+    void normalize(TMatrix &matrix) const;
+    void subCol(TMatrix &matrix, int nCol, double val);
+    void subRow(TMatrix &matrix, int nRow, double val);
 };
 
Index: /trunk/src/version.h
===================================================================
--- /trunk/src/version.h	(revision 148)
+++ /trunk/src/version.h	(revision 149)
@@ -30,19 +30,19 @@
 
 #ifndef BUILD_VERSION_MAJOR
-	//! Major version of current TSPSG build
-	#define BUILD_VERSION_MAJOR 0
+    //! Major version of current TSPSG build
+#   define BUILD_VERSION_MAJOR 0
 #endif // BUILD_VERSION_MAJOR
 #ifndef BUILD_VERSION_MINOR
-	//! Minor version of current TSPSG build
-	#define BUILD_VERSION_MINOR 0
+    //! Minor version of current TSPSG build
+#   define BUILD_VERSION_MINOR 0
 #endif // BUILD_VERSION_MINOR
 #ifndef BUILD_RELEASE
-	//! TSPSG release number
-	#define BUILD_RELEASE 0
+    //! TSPSG release number
+#   define BUILD_RELEASE 0
 #endif // BUILD_RELEASE
 
 #ifndef BUILD_NUMBER
-	//! Current TSPSG build number
-	#define BUILD_NUMBER 0
+    //! Current TSPSG build number
+#   define BUILD_NUMBER 0
 #endif // BUILD_NUMBER
 
@@ -52,17 +52,17 @@
  */
 #ifdef DEBUG
-	#ifndef BUILD_STATUS_TYPE
-		#define BUILD_STATUS (debug build BUILD_NUMBER)
-	#else
-		#define BUILD_STATUS (debug BUILD_STATUS_TYPE BUILD_STATUS_NUMBER)
-	#endif
+#   ifndef BUILD_STATUS_TYPE
+#       define BUILD_STATUS (debug build BUILD_NUMBER)
+#   else
+#       define BUILD_STATUS (debug BUILD_STATUS_TYPE BUILD_STATUS_NUMBER)
+#   endif
 #else
-	#if !defined(TSPSG_RELEASE_BUILD)
-		#define BUILD_STATUS (nightly build)
-	#elif !defined(BUILD_STATUS_TYPE)
-		#define BUILD_STATUS (build BUILD_NUMBER)
-	#else
-		#define BUILD_STATUS (BUILD_STATUS_TYPE BUILD_STATUS_NUMBER)
-	#endif // TSPSG_RELEASE_BUILD
+#   if !defined(TSPSG_RELEASE_BUILD)
+#       define BUILD_STATUS (nightly build)
+#   elif !defined(BUILD_STATUS_TYPE)
+#       define BUILD_STATUS (build BUILD_NUMBER)
+#   else
+#       define BUILD_STATUS (BUILD_STATUS_TYPE BUILD_STATUS_NUMBER)
+#   endif // TSPSG_RELEASE_BUILD
 #endif // DEBUG
 
