Index: /trunk/doxygen.conf
===================================================================
--- /trunk/doxygen.conf	(revision 70)
+++ /trunk/doxygen.conf	(revision 71)
@@ -1339,5 +1339,5 @@
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = 
+TAGFILES               = docs/qt-4.6.tag=http://doc.trolltech.com/4.6
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create 
Index: /trunk/resources/tspsg.rc
===================================================================
--- /trunk/resources/tspsg.rc	(revision 70)
+++ /trunk/resources/tspsg.rc	(revision 71)
@@ -9,4 +9,5 @@
  */
 
+#include <winver.h>
 #include "..\\src\\resource.h"
 #pragma code_page(65001)
@@ -22,16 +23,21 @@
 	PRODUCTVERSION BUILD_VERSION_MAJOR,BUILD_VERSION_MINOR,BUILD_RELEASE,BUILD_NUMBER
 	FILEFLAGSMASK 0x17L
-#ifdef _DEBUG
-	FILEFLAGS 0x1L
+#if defined(_DEBUG) || defined(DEBUG)
+	FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE | VS_FF_PRIVATEBUILD
 #else
-	FILEFLAGS 0x0L
+	#if BUILD_NUMBER == 65535
+		FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
+	#elif BUILD_RELEASE < 11
+			FILEFLAGS VS_FF_PRERELEASE
+	#else
+			FILEFLAGS 0x0L
+	#endif
 #endif
 #ifdef Q_OS_WINCE
-	FILEOS 0x50000L
+	FILEOS VOS_WINCE
 #else
-	FILEOS 0x4L
+	FILEOS VOS__WINDOWS32
 #endif
-	FILETYPE 0x1L
-	FILESUBTYPE 0x0L
+	FILETYPE VFT_APP
 BEGIN
     BLOCK "StringFileInfo"
@@ -48,4 +54,9 @@
             VALUE "ProductName", "TSPSG"
             VALUE "ProductVersion", BUILD_VERSION
+#if defined(_DEBUG) || defined(DEBUG)
+            VALUE "PrivateBuild", "Debug development build"
+#elif BUILD_NUMBER == 65535
+            VALUE "SpecialBuild", "Internal development build"
+#endif
         END
     END
Index: /trunk/src/main.cpp
===================================================================
--- /trunk/src/main.cpp	(revision 70)
+++ /trunk/src/main.cpp	(revision 71)
@@ -33,4 +33,9 @@
 #endif
 
+#ifdef STATIC_BUILD
+	Q_IMPORT_PLUGIN(qjpeg)
+	Q_IMPORT_PLUGIN(qsvg)
+#endif
+
 int main(int argc, char *argv[])
 {
Index: /trunk/src/mainwindow.cpp
===================================================================
--- /trunk/src/mainwindow.cpp	(revision 70)
+++ /trunk/src/mainwindow.cpp	(revision 71)
@@ -83,22 +83,24 @@
 	connect(spinCities,SIGNAL(valueChanged(int)),this,SLOT(spinCitiesValueChanged(int)));
 	setCentralWidget(tabWidget);
-#ifndef Q_OS_WINCE
-QRect rect = geometry();
-	if (settings->value("SavePos",false).toBool()) {
+
+	if (settings->value("SavePos", false).toBool()) {
 		// Loading of saved window state
 		settings->beginGroup("MainWindow");
-		resize(settings->value("Size",size()).toSize());
-		move(settings->value("Position",pos()).toPoint());
-		if (settings->value("Maximized",false).toBool())
-			setWindowState(windowState() | Qt::WindowMaximized);
+#ifndef Q_OS_WINCE
+		restoreGeometry(settings->value("Geometry").toByteArray());
+#endif // Q_OS_WINCE
+		restoreState(settings->value("State").toByteArray());
 		settings->endGroup();
+#ifndef Q_OS_WINCE
 	} else {
 		// Centering main window
+QRect rect = geometry();
 		rect.moveCenter(QApplication::desktop()->availableGeometry(this).center());
 		setGeometry(rect);
-	}
 #endif // Q_OS_WINCE
+	}
+
 	qsrand(QDateTime().currentDateTime().toTime_t());
-	tspmodel = new CTSPModel();
+	tspmodel = new CTSPModel(this);
 	taskView->setModel(tspmodel);
 	connect(tspmodel,SIGNAL(numCitiesChanged(int)),this,SLOT(numCitiesChanged(int)));
@@ -440,24 +442,23 @@
 }
 
-void MainWindow::closeEvent(QCloseEvent *event)
+void MainWindow::closeEvent(QCloseEvent *ev)
 {
 	if (!maybeSave()) {
-		event->ignore();
-		return;
-	}
-	settings->setValue("NumCities",spinCities->value());
+		ev->ignore();
+		return;
+	}
+	settings->setValue("NumCities", spinCities->value());
+
+	// Saving Main Window state
+	if (settings->value("SavePos", false).toBool()) {
+		settings->beginGroup("MainWindow");
 #ifndef Q_OS_WINCE
-	// Saving windows state
-	if (settings->value("SavePos",false).toBool()) {
-		settings->beginGroup("MainWindow");
-		settings->setValue("Maximized",isMaximized());
-		if (!isMaximized()) {
-			settings->setValue("Size",size());
-			settings->setValue("Position",pos());
-		}
+		settings->setValue("Geometry", saveGeometry());
+#endif // Q_OS_WINCE
+		settings->setValue("State", saveState());
 		settings->endGroup();
 	}
-#endif // Q_OS_WINCE
-	QMainWindow::closeEvent(event);
+
+	QMainWindow::closeEvent(ev);
 }
 
@@ -520,11 +521,12 @@
 }
 
-bool MainWindow::loadLanguage(QString lang)
+bool MainWindow::loadLanguage(const QString &lang)
 {
 // i18n
 bool ad = false;
-	if (lang.isEmpty()) {
+QString lng = lang;
+	if (lng.isEmpty()) {
 		ad = settings->value("Language","").toString().isEmpty();
-		lang = settings->value("Language",QLocale::system().name()).toString();
+		lng = settings->value("Language",QLocale::system().name()).toString();
 	}
 static QTranslator *qtTranslator; // Qt library translator
@@ -541,11 +543,11 @@
 	}
 	translator = new QTranslator();
-	if (lang.compare("en") && !lang.startsWith("en_")) {
+	if (lng.compare("en") && !lng.startsWith("en_")) {
 		// Trying to load system Qt library translation...
-		if (qtTranslator->load("qt_" + lang,QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+		if (qtTranslator->load("qt_" + lng,QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
 			qApp->installTranslator(qtTranslator);
 		else
 			// No luck. Let's try to load bundled one.
-			if (qtTranslator->load("qt_" + lang,PATH_I18N))
+			if (qtTranslator->load("qt_" + lng,PATH_I18N))
 				qApp->installTranslator(qtTranslator);
 			else {
@@ -555,5 +557,5 @@
 			}
 		// Now let's load application translation.
-		if (translator->load(lang,PATH_I18N))
+		if (translator->load(lng,PATH_I18N))
 			qApp->installTranslator(translator);
 		else {
@@ -581,5 +583,5 @@
 }
 
-void MainWindow::outputMatrix(tMatrix matrix, QStringList &output, int nRow, int nCol)
+void MainWindow::outputMatrix(const tMatrix &matrix, QStringList &output, int nRow, int nCol)
 {
 int n = spinCities->value();
@@ -589,10 +591,10 @@
 		line = "<tr>";
 		for (int c = 0; c < n; c++) {
-			if (matrix[r][c] == INFINITY)
+			if (matrix.at(r).at(c) == INFINITY)
 				line += "<td align=\"center\">"INFSTR"</td>";
 			else if ((r == nRow) && (c == nCol))
-				line += "<td align=\"center\" class=\"selected\">" + QVariant(matrix[r][c]).toString() + "</td>";
+				line += "<td align=\"center\" class=\"selected\">" + QVariant(matrix.at(r).at(c)).toString() + "</td>";
 			else
-				line += "<td align=\"center\">" + QVariant(matrix[r][c]).toString() + "</td>";
+				line += "<td align=\"center\">" + QVariant(matrix.at(r).at(c)).toString() + "</td>";
 		}
 		line += "</tr>";
@@ -626,5 +628,5 @@
 }
 
-void MainWindow::setFileName(QString fileName)
+void MainWindow::setFileName(const QString &fileName)
 {
 	this->fileName = fileName;
Index: /trunk/src/mainwindow.h
===================================================================
--- /trunk/src/mainwindow.h	(revision 70)
+++ /trunk/src/mainwindow.h	(revision 71)
@@ -60,6 +60,6 @@
 #endif // QT_NO_PRINTER
 	void actionSettingsPreferencesTriggered();
-	void actionSettingsLanguageAutodetectTriggered(bool);
-	void groupSettingsLanguageListTriggered(QAction *);
+	void actionSettingsLanguageAutodetectTriggered(bool checked);
+	void groupSettingsLanguageListTriggered(QAction *action);
 	void actionHelpAboutTriggered();
 // Buttons
@@ -69,10 +69,10 @@
 
 	void dataChanged();
-	void dataChanged(const QModelIndex &, const QModelIndex &);
-	void numCitiesChanged(int);
+	void dataChanged(const QModelIndex &tl, const QModelIndex &br);
+	void numCitiesChanged(int nCities);
 #ifndef QT_NO_PRINTER
 	void printPreview(QPrinter *printer);
 #endif // QT_NO_PRINTER
-	void spinCitiesValueChanged(int);
+	void spinCitiesValueChanged(int nCities);
 
 private:
@@ -86,13 +86,13 @@
 	CTSPModel *tspmodel;
 
-	void closeEvent(QCloseEvent *);
+	void closeEvent(QCloseEvent *ev);
 	void enableSolutionActions(bool enable = true);
 	void initDocStyleSheet();
 	void loadLangList();
-	bool loadLanguage(QString lang = "");
+	bool loadLanguage(const QString &lang = QString());
 	bool maybeSave();
-	void outputMatrix(tMatrix, QStringList &, int nRow = -1, int nCol = -1);
+	void outputMatrix(const tMatrix &matrix, QStringList &output, int nRow = -1, int nCol = -1);
 	bool saveTask();
-	void setFileName(QString fileName = trUtf8("Untitled") + ".tspt");
+	void setFileName(const QString &fileName = trUtf8("Untitled") + ".tspt");
 };
 
Index: /trunk/src/settingsdialog.h
===================================================================
--- /trunk/src/settingsdialog.h	(revision 70)
+++ /trunk/src/settingsdialog.h	(revision 71)
@@ -57,5 +57,5 @@
 	QFrame *lineVertical;
 
-	bool event(QEvent *);
+	bool event(QEvent *ev);
 #endif // Q_OS_WINCE
 
@@ -64,5 +64,5 @@
 	void buttonColorClicked();
 	void buttonFontClicked();
-	void spinRandMinValueChanged(int);
+	void spinRandMinValueChanged(int val);
 };
 
Index: /trunk/src/tspmodel.cpp
===================================================================
--- /trunk/src/tspmodel.cpp	(revision 70)
+++ /trunk/src/tspmodel.cpp	(revision 71)
@@ -133,5 +133,5 @@
  * \sa saveTask()
  */
-bool CTSPModel::loadTask(QString fname)
+bool CTSPModel::loadTask(const QString &fname)
 {
 	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
@@ -220,5 +220,5 @@
  * \sa loadTask()
  */
-bool CTSPModel::saveTask(QString fname)
+bool CTSPModel::saveTask(const QString &fname)
 {
 	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
Index: /trunk/src/tspmodel.h
===================================================================
--- /trunk/src/tspmodel.h	(revision 70)
+++ /trunk/src/tspmodel.h	(revision 71)
@@ -42,15 +42,15 @@
 	CTSPModel(QObject *parent = 0);
 	void clear();
-	int columnCount(const QModelIndex &) const;
-	QVariant data(const QModelIndex &, int) const;
-	Qt::ItemFlags flags(const QModelIndex &) const;
-	QVariant headerData(int, Qt::Orientation, int) const;
-	bool loadTask(QString);
+	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 &) const;
-	bool saveTask(QString);
-	bool setData(const QModelIndex &, const QVariant &, int);
-	void setNumCities(int);
+	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:
Index: /trunk/src/tspsolver.cpp
===================================================================
--- /trunk/src/tspsolver.cpp	(revision 70)
+++ /trunk/src/tspsolver.cpp	(revision 71)
@@ -209,5 +209,5 @@
 }
 
-bool CTSPSolver::findCandidate(tMatrix matrix, int &nRow, int &nCol)
+bool CTSPSolver::findCandidate(const tMatrix &matrix, int &nRow, int &nCol) const
 {
 	nRow = -1;
@@ -232,5 +232,5 @@
 }
 
-double CTSPSolver::findMinInCol(int nCol, tMatrix matrix, int exr)
+double CTSPSolver::findMinInCol(int nCol, const tMatrix &matrix, int exr) const
 {
 double min = INFINITY;
@@ -241,5 +241,5 @@
 }
 
-double CTSPSolver::findMinInRow(int nRow, tMatrix matrix, int exc)
+double CTSPSolver::findMinInRow(int nRow, const tMatrix &matrix, int exc) const
 {
 double min = INFINITY;
@@ -250,5 +250,5 @@
 }
 
-bool CTSPSolver::hasSubCycles(int nRow, int nCol)
+bool CTSPSolver::hasSubCycles(int nRow, int nCol) const
 {
 	if ((nRow < 0) || (nCol < 0) || route.isEmpty() || !(route.size() < nCities - 1) || !route.contains(nCol))
Index: /trunk/src/tspsolver.h
===================================================================
--- /trunk/src/tspsolver.h	(revision 70)
+++ /trunk/src/tspsolver.h	(revision 71)
@@ -76,5 +76,5 @@
 	static QString getVersionId();
 	bool isOptimal() const;
-	sStep *solve(int, tMatrix, QWidget *parent = 0);
+	sStep *solve(int numCities, tMatrix task, QWidget *parent = 0);
 
 private:
@@ -85,12 +85,12 @@
 //	QHash<int,int> forbidden;
 
-	double align(tMatrix &);
+	double align(tMatrix &matrix);
 	void cleanup();
-	bool findCandidate(tMatrix, int &, int &);
-	double findMinInCol(int, tMatrix, int exr = -1);
-	double findMinInRow(int, tMatrix, int exc = -1);
-	bool hasSubCycles(int, int);
-	void subCol(tMatrix &, int, double);
-	void subRow(tMatrix &, int, double);
+	bool 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;
+	bool hasSubCycles(int nRow, int nCol) 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 70)
+++ /trunk/src/version.h	(revision 71)
@@ -57,5 +57,13 @@
 //! Minor version of current TSPSG build
 #define BUILD_VERSION_MINOR 1
-//! TSPSG release number
+/*!
+ * \brief TSPSG release number
+ *
+ *  Release number meanings:
+ *    - 1  --  3: <b>alpha</b> 1 to 3
+ *    - 4  --  7: <b>beta</b> 1 to 4
+ *    - 8  -- 10: <b>rc</b> 1 to 3
+ *    - 11 --  x: <b>release</b> 1 to x-10
+ */
 #define BUILD_RELEASE 2
 
@@ -63,11 +71,5 @@
  * \brief Current TSPSG build number
  *
- * This will only change on releases and will be the same as revision number.
- *
- * Build number meanings:
- *   - 1  --  3: <b>alpha</b> 1 to 3
- *   - 4  --  7: <b>beta</b> 1 to 4
- *   - 8  -- 10: <b>rc</b> 1 to 3
- *   - 11 --  x: <b>release</b> 1 to x-10
+ *  This will only change on releases and will be the same as revision number.
  */
 #define BUILD_NUMBER 65535
@@ -77,14 +79,18 @@
  * \brief TSPSG build status
  *
- * Determined based on BUILD_NUMBER.
+ * Determined based on BUILD_NUMBER and BUILD_RELEASE.
  */
 #if BUILD_NUMBER == 65535
 	#define BUILD_STATUS (dev build)
-#elif BUILD_RELEASE < 4
-	#define BUILD_STATUS (alpha)
-#elif BUILD_RELEASE < 8
-	#define BUILD_STATUS (beta)
-#elif BUILD_RELEASE < 11
-	#define BUILD_STATUS (rc)
+#else
+	#if BUILD_RELEASE < 4
+		#define BUILD_STATUS (alpha)
+	#elif BUILD_RELEASE < 8
+		#define BUILD_STATUS (beta)
+	#elif BUILD_RELEASE < 11
+		#define BUILD_STATUS (rc)
+	#else
+		#define BUILD_STATUS
+	#endif
 #endif // BUILD_NUMBER == 65535
 
Index: /trunk/tspsg.pro
===================================================================
--- /trunk/tspsg.pro	(revision 70)
+++ /trunk/tspsg.pro	(revision 71)
@@ -11,8 +11,19 @@
 ######################################################################
 
+QT += svg
+
 TEMPLATE = app
 TARGET = tspsg
 DEPENDPATH += .
 INCLUDEPATH += .
+
+# A hack to determine whether we have static or dynamic Qt build
+PRL = $$[QT_INSTALL_LIBS] QtCore.prl
+include($$join(PRL, "/"))
+contains(QMAKE_PRL_CONFIG, static) {
+# We "embed" SVG and JPEG support on static build
+	QTPLUGIN += qjpeg qsvg
+	DEFINES += STATIC_BUILD
+}
 
 CONFIG(release, debug|release) {
Index: /trunk/ui/mainwindow.ui
===================================================================
--- /trunk/ui/mainwindow.ui	(revision 70)
+++ /trunk/ui/mainwindow.ui	(revision 71)
@@ -7,6 +7,6 @@
     <x>0</x>
     <y>0</y>
-    <width>344</width>
-    <height>381</height>
+    <width>503</width>
+    <height>387</height>
    </rect>
   </property>
@@ -271,6 +271,6 @@
      <x>0</x>
      <y>0</y>
-     <width>344</width>
-     <height>22</height>
+     <width>503</width>
+     <height>21</height>
     </rect>
    </property>
