Index: src/defaults.h
===================================================================
--- src/defaults.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
+++ src/defaults.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -0,0 +1,82 @@
+/*!
+ * \file defaults.h
+ * \author Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
+ *
+ *  $Id$
+ *  $URL$
+ *
+ * \brief Contains TSPSG defaults.
+ *
+ *  <b>TSPSG: TSP Solver and Generator</b>
+ *
+ *  This file is part of TSPSG.
+ *
+ *  TSPSG is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  TSPSG is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with TSPSG.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DEFAULTS_H
+#define DEFAULTS_H
+
+//! Default number of cities
+#define DEF_NUM_CITIES 5
+
+//////// GENERAL
+//! Default for "Automatically resize rows and columns to their contents"
+#define DEF_AUTOSIZE true
+/*!
+ * \def DEF_USE_NATIVE_DIALOGS
+ * \brief Default for "Use native file dialog".
+ */
+#ifdef Q_OS_WINCE
+	#define DEF_USE_NATIVE_DIALOGS false
+#else
+	#define DEF_USE_NATIVE_DIALOGS true
+#endif // Q_OS_WINCE
+//! Default for "Save main window state and position"
+#define DEF_SAVEPOS false
+
+//////// TASK
+//! Default for "Accuracy of the fractional values"
+#define DEF_FRACTIONAL_ACCURACY 2
+//! Default minimum for random numbers generation
+#define DEF_RAND_MIN 1
+//! Default maximum for random numbers generation
+#define DEF_RAND_MAX 10
+//! Default for "Fractional random values"
+#define DEF_FRACTIONAL_RANDOM false
+
+//////// OUTPUT
+//! Default for "Show solution steps' matrices for every solution step"
+#define DEF_SHOW_MATRIX true
+//! Default for "Show or hide solution steps' matrices based on number of cities in the task"
+#define DEF_USE_SHOW_MATRIX_LIMIT true
+//! Default for "Maximum number of cities to show solution steps' matrices"
+#define DEF_SHOW_MATRIX_LIMIT 15
+//! Default for "Scroll to the end of output after solving"
+#define DEF_SCROLL_TO_END true
+/*!
+ * \def DEF_FON_FAMILY
+ * \brief Default font name.
+ */
+#ifdef Q_OS_WINCE
+	#define DEF_FONT_FAMILY "Tahoma"
+#else
+	#define DEF_FONT_FAMILY "Courier New"
+#endif
+//! Default font size
+#define DEF_FONT_SIZE 10
+//! Default font color
+#define DEF_FONT_COLOR Qt::black
+
+#endif // DEFAULTS_H
Index: src/globals.h
===================================================================
--- src/globals.h	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/globals.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*!
  * \file globals.h
- * \author Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -37,43 +37,8 @@
 // OS and ARCH detection
 #include "os.h"
+// TSPSG Defaults
+#include "defaults.h"
 
 // DEFINES
-// Default values
-//! Default minimum for random numbers generation
-#define DEF_RAND_MIN 1
-//! Default maximum for random numbers generation
-#define DEF_RAND_MAX 10
-//! Default number of cities
-#define DEF_NUM_CITIES 5
-/*!
- * \def DEF_USE_NATIVE_DIALOGS
- * \brief Default for "Use native file dialog".
- */
-#ifdef Q_OS_WINCE
-	#define DEF_USE_NATIVE_DIALOGS false
-#else
-	#define DEF_USE_NATIVE_DIALOGS true
-#endif // Q_OS_WINCE
-//! Default for "Automatically resize rows and columns to their contents"
-#define DEF_AUTOSIZE true
-//! Default for "Save main window state and position"
-#define DEF_SAVEPOS false
-//! Default for "Fractional random values"
-#define DEF_FRACTIONAL_RANDOM false
-//! Default for "Show solution steps' matrices for every solution step"
-#define DEF_SHOW_MATRIX true
-//! Default for "Show or hide solution steps' matrices based on number of cities in the task"
-#define DEF_USE_SHOW_MATRIX_LIMIT true
-//! Default for "Maximum number of cities to show solution steps' matrices"
-#define DEF_SHOW_MATRIX_LIMIT 15
-//! Default for "Scroll to the end of output after solving"
-#define DEF_SCROLL_TO_END true
-//! Default font name
-#define DEF_FONT_FAMILY "Courier New"
-//! Default font size
-#define DEF_FONT_SIZE 10
-//! Default font color
-#define DEF_FONT_COLOR Qt::black
-
 //! Maximum available number of cities
 #define MAX_NUM_CITIES 50
@@ -131,7 +96,7 @@
  * \return \c true if \a x countains an integer, oherwise \c false.
  */
-inline bool isInteger(double x)
+inline bool isInteger(qreal x)
 {
-double i;
+qreal i;
 	return (modf(x, &i) == 0.0);
 }
Index: src/main.cpp
===================================================================
--- src/main.cpp	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/main.cpp	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*
  *  TSPSG: TSP Solver and Generator
- *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ *  Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
Index: src/mainwindow.cpp
===================================================================
--- src/mainwindow.cpp	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/mainwindow.cpp	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*
  *  TSPSG: TSP Solver and Generator
- *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ *  Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -124,11 +124,11 @@
 		return;
 
-QStringList filters(trUtf8("All Supported Formats") + " (*.tspt *.zkt)");
-	filters.append(trUtf8("%1 Task Files").arg("TSPSG") + " (*.tspt)");
-	filters.append(trUtf8("%1 Task Files").arg("ZKomModRd") + " (*.zkt)");
-	filters.append(trUtf8("All Files") + " (*)");
+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") + " (*)");
 
 QFileDialog::Options opts = settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool() ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog;
-QString file = QFileDialog::getOpenFileName(this, trUtf8("Task Load"), QString(), filters.join(";;"), NULL, opts);
+QString file = QFileDialog::getOpenFileName(this, tr("Task Load"), QString(), filters.join(";;"), NULL, opts);
 	if (file.isEmpty() || !QFileInfo(file).isFile())
 		return;
@@ -144,5 +144,5 @@
 void MainWindow::actionFileSaveTriggered()
 {
-	if ((fileName == trUtf8("Untitled") + ".tspt") || (!fileName.endsWith(".tspt",Qt::CaseInsensitive)))
+	if ((fileName == tr("Untitled") + ".tspt") || (!fileName.endsWith(".tspt",Qt::CaseInsensitive)))
 		saveTask();
 	else
@@ -160,5 +160,5 @@
 static QString selectedFile;
 	if (selectedFile.isEmpty()) {
-		if (fileName == trUtf8("Untitled") + ".tspt") {
+		if (fileName == tr("Untitled") + ".tspt") {
 #ifndef QT_NO_PRINTER
 			selectedFile = "solution.pdf";
@@ -177,11 +177,11 @@
 QStringList filters;
 #ifndef QT_NO_PRINTER
-	filters.append(trUtf8("PDF Files") + " (*.pdf)");
+	filters.append(tr("PDF Files") + " (*.pdf)");
 #endif
-	filters.append(trUtf8("HTML Files") + " (*.html *.htm)");
+	filters.append(tr("HTML Files") + " (*.html *.htm)");
 #if QT_VERSION >= 0x040500
-	filters.append(trUtf8("OpenDocument Files") + " (*.odt)");
+	filters.append(tr("OpenDocument Files") + " (*.odt)");
 #endif // QT_VERSION >= 0x040500
-	filters.append(trUtf8("All Files") + " (*)");
+	filters.append(tr("All Files") + " (*)");
 
 QFileDialog::Options opts = settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool() ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog;
@@ -252,5 +252,5 @@
 	if (sd.colorChanged() || sd.fontChanged()) {
 		initDocStyleSheet();
-		if (!output.isEmpty() && sd.colorChanged() && (QMessageBox(QMessageBox::Question,trUtf8("Settings Changed"),trUtf8("You have changed color settings.\nDo you wish to apply them to current solution text?"),QMessageBox::Yes | QMessageBox::No,this).exec() == QMessageBox::Yes)) {
+		if (!output.isEmpty() && sd.colorChanged() && (QMessageBox(QMessageBox::Question,tr("Settings Changed"),tr("You have changed color settings.\nDo you wish to apply them to current solution text?"),QMessageBox::Yes | QMessageBox::No,this).exec() == QMessageBox::Yes)) {
 			QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 			solutionText->clear();
@@ -265,5 +265,5 @@
 	if (checked) {
 		settings->remove("Language");
-		QMessageBox(QMessageBox::Information,trUtf8("Language change"),trUtf8("Language will be autodetected on next application start."),QMessageBox::Ok,this).exec();
+		QMessageBox(QMessageBox::Information,tr("Language change"),tr("Language will be autodetected on next application start."),QMessageBox::Ok,this).exec();
 	} else
 		settings->setValue("Language",groupSettingsLanguageList->checkedAction()->data().toString());
@@ -274,10 +274,10 @@
 	if (actionSettingsLanguageAutodetect->isChecked()) {
 		// We have language autodetection. It needs to be disabled to change language.
-		if (QMessageBox(QMessageBox::Question,trUtf8("Language change"),trUtf8("You have language autodetection turned on.\nIt needs to be off.\nDo you wish to turn it off?"),QMessageBox::Yes | QMessageBox::No,this).exec() == QMessageBox::Yes) {
+		if (QMessageBox(QMessageBox::Question,tr("Language change"),tr("You have language autodetection turned on.\nIt needs to be off.\nDo you wish to turn it off?"),QMessageBox::Yes | QMessageBox::No,this).exec() == QMessageBox::Yes) {
 			actionSettingsLanguageAutodetect->trigger();
 		} else
 			return;
 	}
-bool untitled = (fileName == trUtf8("Untitled") + ".tspt");
+bool untitled = (fileName == tr("Untitled") + ".tspt");
 	if (loadLanguage(action->data().toString())) {
 		QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
@@ -357,5 +357,5 @@
 
 	dlg->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
-	dlg->setWindowTitle(trUtf8("About TSPSG"));
+	dlg->setWindowTitle(tr("About TSPSG"));
 	dlg->setLayout(vb);
 
@@ -383,5 +383,5 @@
 {
 TMatrix matrix;
-QList<double> row;
+QList<qreal> row;
 int n = spinCities->value();
 bool ok;
@@ -389,7 +389,7 @@
 		row.clear();
 		for (int c = 0; c < n; c++) {
-			row.append(tspmodel->index(r,c).data(Qt::UserRole).toDouble(&ok));
+			row.append(tspmodel->index(r,c).data(Qt::UserRole).toReal(&ok));
 			if (!ok) {
-				QMessageBox(QMessageBox::Critical,trUtf8("Data error"),trUtf8("Error in cell [Row %1; Column %2]: Invalid data format.").arg(r + 1).arg(c + 1),QMessageBox::Ok,this).exec();
+				QMessageBox(QMessageBox::Critical,tr("Data error"),tr("Error in cell [Row %1; Column %2]: Invalid data format.").arg(r + 1).arg(c + 1),QMessageBox::Ok,this).exec();
 				return;
 			}
@@ -404,9 +404,9 @@
 QColor color = settings->value("Output/Color",DEF_FONT_COLOR).value<QColor>();
 	output.clear();
-	output.append("<p>" + trUtf8("Variant #%1").arg(spinVariant->value()) + "</p>");
-	output.append("<p>" + trUtf8("Task:") + "</p>");
+	output.append("<p>" + tr("Variant #%1").arg(spinVariant->value()) + "</p>");
+	output.append("<p>" + tr("Task:") + "</p>");
 	outputMatrix(matrix, output);
 	output.append("<hr>");
-	output.append("<p>" + trUtf8("Solution of Variant #%1 task").arg(spinVariant->value()) + "</p>");
+	output.append("<p>" + tr("Solution of Variant #%1 task").arg(spinVariant->value()) + "</p>");
 SStep *step = root;
 	n = 1;
@@ -414,9 +414,9 @@
 		if (step->prNode->prNode != NULL || ((step->prNode->prNode == NULL) && (step->plNode->prNode == NULL))) {
 			if (n != spinCities->value()) {
-				output.append("<p>" + trUtf8("Step #%1").arg(n++) + "</p>");
+				output.append("<p>" + tr("Step #%1").arg(n++) + "</p>");
 				if (settings->value("Output/ShowMatrix", DEF_SHOW_MATRIX).toBool() && settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() && (spinCities->value() <= settings->value("Output/ShowMatrixLimit", DEF_SHOW_MATRIX_LIMIT).toInt())) {
 					outputMatrix(*step, output);
 				}
-				output.append("<p>" + trUtf8("Selected candidate for branching: %1.").arg(trUtf8("(%1;%2)").arg(step->candidate.nRow + 1).arg(step->candidate.nCol + 1)) + "</p>");
+				output.append("<p>" + tr("Selected candidate for branching: %1.").arg(tr("(%1;%2)").arg(step->candidate.nRow + 1).arg(step->candidate.nCol + 1)) + "</p>");
 				if (!step->alts.empty()) {
 SCandidate cand;
@@ -425,7 +425,7 @@
 						if (!alts.isEmpty())
 							alts += ", ";
-						alts += trUtf8("(%1;%2)").arg(cand.nRow + 1).arg(cand.nCol + 1);
+						alts += tr("(%1;%2)").arg(cand.nRow + 1).arg(cand.nCol + 1);
 					}
-					output.append("<p class=\"hasalts\">" + trUtf8("%n alternate candidate(s) for branching: %1.","",step->alts.count()).arg(alts) + "</p>");
+					output.append("<p class=\"hasalts\">" + tr("%n alternate candidate(s) for branching: %1.","",step->alts.count()).arg(alts) + "</p>");
 				}
 				output.append("<p>&nbsp;</p>");
@@ -440,20 +440,20 @@
 	}
 	if (solver.isOptimal())
-		output.append("<p>" + trUtf8("Optimal path:") + "</p>");
+		output.append("<p>" + tr("Optimal path:") + "</p>");
 	else
-		output.append("<p>" + trUtf8("Resulting path:") + "</p>");
+		output.append("<p>" + tr("Resulting path:") + "</p>");
 	output.append("<p>&nbsp;&nbsp;" + solver.getSortedPath() + "</p>");
 	if (isInteger(step->price))
-		output.append("<p>" + trUtf8("The price is <b>%n</b> unit(s).", "", step->price) + "</p>");
+		output.append("<p>" + tr("The price is <b>%n</b> unit(s).", "", step->price) + "</p>");
 	else
-		output.append("<p>" + trUtf8("The price is <b>%1</b> units.").arg(step->price, 0, 'f', 2) + "</p>");
+		output.append("<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()) {
 		output.append("<p>&nbsp;</p>");
-		output.append("<p>" + trUtf8("<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>");
+		output.append("<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>");
 	}
 	output.append("<p></p>");
 
 	solutionText->setHtml(output.join(""));
-	solutionText->setDocumentTitle(trUtf8("Solution of Variant #%1 task").arg(spinVariant->value()));
+	solutionText->setDocumentTitle(tr("Solution of Variant #%1 task").arg(spinVariant->value()));
 
 	if (settings->value("Output/ScrollToEnd", DEF_SCROLL_TO_END).toBool()) {
@@ -624,5 +624,5 @@
 		translator = NULL;
 		if (!ad)
-			QMessageBox(QMessageBox::Warning,trUtf8("Language Change"),trUtf8("Unable to load translation language."),QMessageBox::Ok,this).exec();
+			QMessageBox(QMessageBox::Warning,tr("Language Change"),tr("Unable to load translation language."),QMessageBox::Ok,this).exec();
 		return false;
 	}
@@ -634,5 +634,5 @@
 	if (!isWindowModified())
 		return true;
-int res = QMessageBox(QMessageBox::Warning,trUtf8("Unsaved Changes"),trUtf8("Would you like to save changes in current task?"),QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel,this).exec();
+int res = QMessageBox(QMessageBox::Warning,tr("Unsaved Changes"),tr("Would you like to save changes in current task?"),QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel,this).exec();
 	if (res == QMessageBox::Save)
 		return saveTask();
@@ -654,5 +654,5 @@
 				line += "<td align=\"center\">"INFSTR"</td>";
 			else
-				line += isInteger(matrix.at(r).at(c)) ? QString("<td align=\"center\">%1</td>").arg(matrix.at(r).at(c)) : QString("<td align=\"center\">%1</td>").arg(matrix.at(r).at(c), 0, 'f', 2);
+				line += isInteger(matrix.at(r).at(c)) ? QString("<td align=\"center\">%1</td>").arg(matrix.at(r).at(c)) : QString("<td align=\"center\">%1</td>").arg(matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
 		}
 		line += "</tr>";
@@ -673,5 +673,5 @@
 				line += "<td align=\"center\">"INFSTR"</td>";
 			else if ((r == step.candidate.nRow) && (c == step.candidate.nCol))
-				line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\" class=\"selected\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\" class=\"selected\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2);
+				line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\" class=\"selected\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\" class=\"selected\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
 			else {
 SCandidate cand;
@@ -679,7 +679,7 @@
 				cand.nCol = c;
 				if (step.alts.contains(cand))
-					line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\" class=\"alternate\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\" class=\"alternate\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2);
+					line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\" class=\"alternate\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\" class=\"alternate\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
 				else
-					line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2);
+					line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
 			}
 		}
@@ -716,6 +716,6 @@
 
 bool MainWindow::saveTask() {
-QStringList filters(trUtf8("%1 Task File").arg("TSPSG") + " (*.tspt)");
-	filters.append(trUtf8("All Files") + " (*)");
+QStringList filters(tr("%1 Task File").arg("TSPSG") + " (*.tspt)");
+	filters.append(tr("All Files") + " (*)");
 QString file;
 	if (fileName.endsWith(".tspt", Qt::CaseInsensitive))
@@ -725,5 +725,5 @@
 
 QFileDialog::Options opts = settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool() ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog;
-	file = QFileDialog::getSaveFileName(this, trUtf8("Task Save"), file, filters.join(";;"), NULL, opts);
+	file = QFileDialog::getSaveFileName(this, tr("Task Save"), file, filters.join(";;"), NULL, opts);
 
 	if (file.isEmpty())
@@ -740,5 +740,5 @@
 {
 	this->fileName = fileName;
-	setWindowTitle(QString("%1[*] - %2").arg(QFileInfo(fileName).completeBaseName()).arg(trUtf8("Travelling Salesman Problem")));
+	setWindowTitle(QString("%1[*] - %2").arg(QFileInfo(fileName).completeBaseName()).arg(tr("Travelling Salesman Problem")));
 }
 
Index: src/mainwindow.h
===================================================================
--- src/mainwindow.h	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/mainwindow.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*!
  * \file mainwindow.h
- * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -39,5 +39,5 @@
 /*!
  * \brief Class for handling Main Window UI and logic.
- * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  */
 class MainWindow: public QMainWindow, Ui::MainWindow
@@ -98,5 +98,5 @@
 	void retranslateUi(bool all = true);
 	bool saveTask();
-	void setFileName(const QString &fileName = trUtf8("Untitled") + ".tspt");
+	void setFileName(const QString &fileName = tr("Untitled") + ".tspt");
 	void setupUi();
 	void toggleSolutionActions(bool enable = true);
Index: src/os.h
===================================================================
--- src/os.h	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/os.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*!
  * \file os.h
- * \author Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
Index: src/resource.h
===================================================================
--- src/resource.h	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/resource.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*!
  * \file resource.h
- * \author Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
Index: src/settingsdialog.cpp
===================================================================
--- src/settingsdialog.cpp	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/settingsdialog.cpp	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*
  *  TSPSG: TSP Solver and Generator
- *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ *  Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -34,18 +34,10 @@
 {
 	setupUi(this);
-	// Laying out elements
-/*	layoutCitiesLimit = new QHBoxLayout();
-	layoutCitiesLimit->setMargin(0);
-	layoutCitiesLimit->setSpacing(0);
-	layoutCitiesLimit->addSpacing(10);
-	layoutCitiesLimit->addWidget(cbCitiesLimit);
-	layoutCitiesLimit->addWidget(spinCitiesLimit);
-	layoutCitiesLimit->addStretch();
-*/
+
 	buttonBox->button(QDialogButtonBox::Save)->setIcon(QIcon(":/images/icons/button_ok.png"));
-	buttonBox->button(QDialogButtonBox::Save)->setStatusTip(trUtf8("Save new preferences"));
+	buttonBox->button(QDialogButtonBox::Save)->setStatusTip(tr("Save new preferences"));
 	buttonBox->button(QDialogButtonBox::Save)->setCursor(QCursor(Qt::PointingHandCursor));
 	buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QIcon(":/images/icons/button_cancel.png"));
-	buttonBox->button(QDialogButtonBox::Cancel)->setStatusTip(trUtf8("Close without saving preferences"));
+	buttonBox->button(QDialogButtonBox::Cancel)->setStatusTip(tr("Close without saving preferences"));
 	buttonBox->button(QDialogButtonBox::Cancel)->setCursor(QCursor(Qt::PointingHandCursor));
 
@@ -80,7 +72,7 @@
 	cbSaveState->setObjectName("cbSaveState");
 #ifndef QT_NO_STATUSTIP
-	cbSaveState->setStatusTip(trUtf8("Restore main window state and position on application restart"));
+	cbSaveState->setStatusTip(tr("Restore main window state and position on application restart"));
 #endif // QT_NO_STATUSTIP
-	cbSaveState->setText(trUtf8("Save main window state and position"));
+	cbSaveState->setText(tr("Save main window state and position"));
 	cbSaveState->setCursor(QCursor(Qt::PointingHandCursor));
 
@@ -105,5 +97,5 @@
 	labelHint->setWordWrap(true);
 #ifndef QT_NO_STATUSTIP
-	labelHint->setStatusTip(trUtf8("Hover mouse pointer over dialog elements to get additional help"));
+	labelHint->setStatusTip(tr("Hover mouse pointer over dialog elements to get additional help"));
 #endif // QT_NO_STATUSTIP
 
@@ -121,5 +113,5 @@
 
 	vbox1 = static_cast<QVBoxLayout *>(tabGeneral->layout());
-	vbox1->insertWidget(vbox2->indexOf(cbUseNativeDialogs) + 1, cbSaveState);
+	vbox1->insertWidget(vbox1->indexOf(cbUseNativeDialogs) + 1, cbSaveState);
 
 	// Bottom part (with grey bg)
@@ -152,9 +144,4 @@
 	settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
 
-	spinRandMin->setMaximum(MAX_RAND_VALUE);
-	spinRandMin->setValue(settings->value("MinCost",DEF_RAND_MIN).toInt());
-	spinRandMax->setMaximum(MAX_RAND_VALUE);
-	spinRandMax->setValue(settings->value("MaxCost",DEF_RAND_MAX).toInt());
-	cbFractionalRandom->setChecked(settings->value("FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool());
 	cbAutosize->setChecked(settings->value("Autosize", DEF_AUTOSIZE).toBool());
 	cbUseNativeDialogs->setChecked(settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool());
@@ -162,4 +149,13 @@
 	cbSaveState->setChecked(settings->value("SavePos", DEF_SAVEPOS).toBool());
 #endif // Q_OS_WINCE
+
+	settings->beginGroup("Task");
+	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");
@@ -206,7 +202,11 @@
 	settings->setValue("UseNativeDialogs", cbUseNativeDialogs->isChecked());
 	settings->setValue("Autosize", cbAutosize->isChecked());
-	settings->setValue("MinCost", spinRandMin->value());
-	settings->setValue("MaxCost", spinRandMax->value());
+
+	settings->beginGroup("Task");
+	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");
Index: src/settingsdialog.h
===================================================================
--- src/settingsdialog.h	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/settingsdialog.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*!
  * \file settingsdialog.h
- * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -35,5 +35,5 @@
 /*!
  * \brief Class for handling Settings Dialog UI and logic.
- * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  */
 class SettingsDialog: public QDialog, Ui::SettingsDialog
Index: src/tspmodel.cpp
===================================================================
--- src/tspmodel.cpp	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/tspmodel.cpp	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*
  *  TSPSG: TSP Solver and Generator
- *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ *  Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -82,5 +82,5 @@
 		if (index.row() < nCities && index.column() < nCities)
 			if (table[index.row()][index.column()] == INFINITY)
-				return trUtf8(INFSTR);
+				return tr(INFSTR);
 			else
 //! \hack HACK: Converting to string to prevent spinbox in edit mode
@@ -119,7 +119,7 @@
 	if (role == Qt::DisplayRole) {
 		if (orientation == Qt::Vertical)
-			return trUtf8("City %1").arg(section + 1);
+			return tr("City %1").arg(section + 1);
 		else
-			return trUtf8("%1").arg(section + 1);
+			return tr("%1").arg(section + 1);
 	}
 	return QVariant();
@@ -139,5 +139,5 @@
 	if (!f.open(QIODevice::ReadOnly)) {
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),QString(trUtf8("Unable to open task file.\nError: %1")).arg(f.errorString()),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Load"),QString(tr("Unable to open task file.\nError: %1")).arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -163,5 +163,5 @@
 		f.close();
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unknown file format or file is corrupted."),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Load"),tr("Unable to load task:") + "\n" + tr("Unknown file format or file is corrupted."),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -191,6 +191,6 @@
 void CTSPModel::randomize()
 {
-int randMin = settings->value("MinCost",DEF_RAND_MIN).toInt();
-int randMax = settings->value("MaxCost",DEF_RAND_MAX).toInt();
+int randMin = settings->value("Task/RandMin",DEF_RAND_MIN).toInt();
+int randMax = settings->value("Task/RandMax",DEF_RAND_MAX).toInt();
 	for (int r = 0; r < nCities; r++)
 		for (int c = 0; c < nCities; c++)
@@ -226,5 +226,5 @@
 	if (!f.open(QIODevice::WriteOnly)) {
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),QString(trUtf8("Unable to create task file.\nError: %1\nMaybe, file is read-only?")).arg(f.errorString()),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Save"),QString(tr("Unable to create task file.\nError: %1\nMaybe, file is read-only?")).arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -234,5 +234,5 @@
 		f.close();
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Save"),tr("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -242,5 +242,5 @@
 		f.close();
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Save"),tr("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -250,5 +250,5 @@
 		f.close();
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Save"),tr("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -258,5 +258,5 @@
 		f.close();
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Save"),tr("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -266,5 +266,5 @@
 		f.close();
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Save"),tr("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -274,5 +274,5 @@
 		f.close();
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Save"),tr("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -281,9 +281,9 @@
 		for (int c = 0; c < nCities; c++)
 			if (r != c) {
-				ds << table[r][c];
+				ds << static_cast<double>(table[r][c]); // We cast to double because qreal may be float on some platforms and we store double values in file
 				if (f.error() != QFile::NoError) {
 					f.close();
 					QApplication::restoreOverrideCursor();
-					QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
+					QMessageBox(QMessageBox::Critical,tr("Task Save"),tr("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 					return false;
 				}
@@ -312,5 +312,5 @@
 		else {
 bool ok;
-double tmp = value.toDouble(&ok);
+qreal tmp = value.toReal(&ok);
 			if (!ok || tmp < 0)
 				return false;
@@ -354,11 +354,11 @@
 		return false;
 	else if (status == QDataStream::ReadPastEnd)
-		err = trUtf8("Unexpected end of file.");
+		err = tr("Unexpected end of file.");
 	else if (status == QDataStream::ReadCorruptData)
-		err = trUtf8("Corrupt data read. File possibly corrupted.");
+		err = tr("Corrupt data read. File possibly corrupted.");
 	else
-		err = trUtf8("Unknown error.");
+		err = tr("Unknown error.");
 	QApplication::restoreOverrideCursor();
-	QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + err,QMessageBox::Ok).exec();
+	QMessageBox(QMessageBox::Critical,tr("Task Load"),tr("Unable to load task:") + "\n" + err,QMessageBox::Ok).exec();
 	return true;
 }
@@ -377,5 +377,5 @@
 	if (version > TSPT_VERSION) {
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("File version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Load"),tr("Unable to load task:") + "\n" + tr("File version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -391,5 +391,5 @@
 	if ((size < 3) || (size > MAX_NUM_CITIES)) {
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Load"),tr("Unable to load task:") + "\n" + tr("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -398,9 +398,12 @@
 		emit numCitiesChanged(size);
 	}
+
+double x; // We need this as qreal 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 >> table[r][c];
+				*ds >> x;
+				table[r][c] = x;
 				if (loadError(ds->status())) {
 					clear();
@@ -426,5 +429,5 @@
 	if (version > ZKT_VERSION) {
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("File version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Load"),tr("Unable to load task:") + "\n" + tr("File version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -436,5 +439,5 @@
 	if ((size < 3) || (size > 5)) {
 		QApplication::restoreOverrideCursor();
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec();
+		QMessageBox(QMessageBox::Critical,tr("Task Load"),tr("Unable to load task:") + "\n" + tr("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -444,8 +447,8 @@
 	}
 	// Travel costs
-double val;
+qreal val;
 	for (int r = 0; r < 5; r++)
 		for (int c = 0; c < 5; c++)
-			if ((r != c) && (r < size)) {
+			if ((r != c) && (r < size) && (c < size)) {
 				ds->readRawData(reinterpret_cast<char *>(&val),8);
 				if (loadError(ds->status())) {
@@ -466,11 +469,12 @@
 }
 
-inline double CTSPModel::rand(int min, int max) const
-{
-double r;
-	if (settings->value("FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool())
-		r = (double)qRound((double)qrand() / RAND_MAX * (max - min) * 100) / 100;
-	else
-		r = qRound((double)qrand() / RAND_MAX * (max - min));
+inline qreal CTSPModel::rand(int min, int max) const
+{
+qreal r;
+	if (settings->value("Task/FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool()) {
+qreal x = qPow(10, settings->value("Task/FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
+		r = (qreal)qRound((qreal)qrand() / RAND_MAX * (max - min) * x) / x;
+	} else
+		r = qRound((qreal)qrand() / RAND_MAX * (max - min));
 	return min + r;
 }
Index: src/tspmodel.h
===================================================================
--- src/tspmodel.h	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/tspmodel.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*!
  * \file tspmodel.h
- * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -33,5 +33,5 @@
 /*!
  * \brief This class implements table model for manipulating a task.
- * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  */
 class CTSPModel: public QAbstractTableModel
@@ -64,10 +64,10 @@
 private:
 	QSettings *settings;
-	QVector<QVector<double> > table;
+	QVector<QVector<qreal> > table;
 	quint16 nCities;
 	bool loadError(QDataStream::Status);
 	bool loadTSPT(QDataStream *);
 	bool loadZKT(QDataStream *);
-	double rand(int, int) const;
+	qreal rand(int, int) const;
 };
 
Index: src/tspsolver.cpp
===================================================================
--- src/tspsolver.cpp	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/tspsolver.cpp	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*
  *  TSPSG: TSP Solver and Generator
- *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ *  Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -40,10 +40,10 @@
 
 int i = 0; // We start from City 1
-QString path = trUtf8("City %1").arg(1) + " -> ";
+QString path = tr("City %1").arg(1) + " -> ";
 	while ((i = route[i]) != 0) {
-		path += trUtf8("City %1").arg(i + 1) + " -> ";
+		path += tr("City %1").arg(i + 1) + " -> ";
 	}
 	// And finish in City 1, too
-	path += trUtf8("City %1").arg(1);
+	path += tr("City %1").arg(1);
 
 	return path;
@@ -89,10 +89,10 @@
 QProgressBar *pb = new QProgressBar(&pd);
 	pb->setAlignment(Qt::AlignCenter);
-	pb->setFormat(trUtf8("%v of %m parts found"));
+	pb->setFormat(tr("%v of %m parts found"));
 	pd.setBar(pb);
 	pd.setMaximum(nCities);
 	pd.setMinimumDuration(1000);
-	pd.setLabelText(trUtf8("Calculating optimal route..."));
-	pd.setWindowTitle(trUtf8("Solution Progress"));
+	pd.setLabelText(tr("Calculating optimal route..."));
+	pd.setWindowTitle(tr("Solution Progress"));
 	pd.setWindowModality(Qt::ApplicationModal);
 	pd.setValue(0);
@@ -106,5 +106,5 @@
 int nRow, nCol;
 bool firstStep = true;
-double check;
+qreal check;
 	while (this->route.size() < nCities) {
 //		forbidden.clear();
@@ -168,5 +168,5 @@
 	if (!root && !pd.wasCanceled()) {
 		pd.reset();
-		QMessageBox(QMessageBox::Warning,trUtf8("Solution Result"),trUtf8("Unable to find solution.\nMaybe, this task has no solutions."),QMessageBox::Ok,parent).exec();
+		QMessageBox(QMessageBox::Warning,tr("Solution Result"),tr("Unable to find solution.\nMaybe, this task has no solutions."),QMessageBox::Ok,parent).exec();
 	}
 
@@ -188,8 +188,8 @@
 /* Privates **********************************************************/
 
-double CTSPSolver::align(TMatrix &matrix)
-{
-double r = 0;
-double min;
+qreal CTSPSolver::align(TMatrix &matrix)
+{
+qreal r = 0;
+qreal min;
 	for (int k = 0; k < nCities; k++) {
 		min = findMinInRow(k,matrix);
@@ -240,6 +240,6 @@
 QList<SCandidate> alts;
 SCandidate cand;
-double h = -1;
-double sum;
+qreal h = -1;
+qreal sum;
 	for (int r = 0; r < nCities; r++)
 		for (int c = 0; c < nCities; c++)
@@ -261,7 +261,7 @@
 }
 
-double CTSPSolver::findMinInCol(int nCol, const TMatrix &matrix, int exr) const
-{
-double min = INFINITY;
+qreal CTSPSolver::findMinInCol(int nCol, const TMatrix &matrix, int exr) const
+{
+qreal min = INFINITY;
 	for (int k = 0; k < nCities; k++)
 		if ((k != exr) && (min > matrix.at(k).at(nCol)))
@@ -270,7 +270,7 @@
 }
 
-double CTSPSolver::findMinInRow(int nRow, const TMatrix &matrix, int exc) const
-{
-double min = INFINITY;
+qreal CTSPSolver::findMinInRow(int nRow, const TMatrix &matrix, int exc) const
+{
+qreal min = INFINITY;
 	for (int k = 0; k < nCities; k++)
 		if (((k != exc)) && (min > matrix.at(nRow).at(k)))
@@ -293,5 +293,5 @@
 }
 
-void CTSPSolver::subCol(TMatrix &matrix, int nCol, double val)
+void CTSPSolver::subCol(TMatrix &matrix, int nCol, qreal val)
 {
 	for (int k = 0; k < nCities; k++)
@@ -300,5 +300,5 @@
 }
 
-void CTSPSolver::subRow(TMatrix &matrix, int nRow, double val)
+void CTSPSolver::subRow(TMatrix &matrix, int nRow, qreal val)
 {
 	for (int k = 0; k < nCities; k++)
Index: src/tspsolver.h
===================================================================
--- src/tspsolver.h	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/tspsolver.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*!
  * \file tspsolver.h
- * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -34,5 +34,5 @@
 
 //! A matrix of city-to-city travel costs.
-typedef QList<QList<double> > TMatrix;
+typedef QList<QList<qreal> > TMatrix;
 
 /*!
@@ -60,5 +60,5 @@
 struct SStep {
 	TMatrix matrix; //!< This step's matrix
-	double price; //!< The price of travel to this step
+	qreal price; //!< The price of travel to this step
 	SCandidate candidate; //!< A candiadate for branching in the current matrix
 	QList<SCandidate> alts; //!< A list of alternative branching candidates
@@ -75,5 +75,5 @@
 /*!
  * \brief This class solves Travelling Salesman Problem task.
- * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  * \todo TODO: Deletion of solution tree on destroy and cleanup.
@@ -98,13 +98,13 @@
 //	QHash<int,int> forbidden;
 
-	double align(TMatrix &matrix);
+	qreal align(TMatrix &matrix);
 	void cleanup();
 	void deleteNode(SStep *&node);
 	QList<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;
+	qreal findMinInCol(int nCol, const TMatrix &matrix, int exr = -1) const;
+	qreal findMinInRow(int nRow, const TMatrix &matrix, int exc = -1) const;
 	bool hasSubCycles(int nRow, int nCol) const;
-	void subCol(TMatrix &matrix, int nCol, double val);
-	void subRow(TMatrix &matrix, int nRow, double val);
+	void subCol(TMatrix &matrix, int nCol, qreal val);
+	void subRow(TMatrix &matrix, int nRow, qreal val);
 };
 
Index: src/version.h
===================================================================
--- src/version.h	(revision a5be8eb2c800af1d0a699028fd94a806045b47f4)
+++ src/version.h	(revision fcd8c1e4c16ec72ea29ba334dddda5939726912e)
@@ -1,5 +1,5 @@
 /*!
  * \file version.h
- * \author Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
@@ -29,5 +29,5 @@
  * \image html tspsg.png
  *  <b>TSPSG: TSP Solver and Generator</b>
- * \author Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
+ * \author Copyright (C) 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
  *
  *  $Id$
