Index: src/main.cpp
===================================================================
--- src/main.cpp	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/main.cpp	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -33,4 +33,9 @@
 #endif
 
+#ifdef STATIC_BUILD
+	Q_IMPORT_PLUGIN(qjpeg)
+	Q_IMPORT_PLUGIN(qsvg)
+#endif
+
 int main(int argc, char *argv[])
 {
Index: src/mainwindow.cpp
===================================================================
--- src/mainwindow.cpp	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/mainwindow.cpp	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -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: src/mainwindow.h
===================================================================
--- src/mainwindow.h	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/mainwindow.h	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -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: src/settingsdialog.h
===================================================================
--- src/settingsdialog.h	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/settingsdialog.h	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -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: src/tspmodel.cpp
===================================================================
--- src/tspmodel.cpp	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/tspmodel.cpp	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -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: src/tspmodel.h
===================================================================
--- src/tspmodel.h	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/tspmodel.h	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -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: src/tspsolver.cpp
===================================================================
--- src/tspsolver.cpp	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/tspsolver.cpp	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -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: src/tspsolver.h
===================================================================
--- src/tspsolver.h	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/tspsolver.h	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -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: src/version.h
===================================================================
--- src/version.h	(revision 3b1caa32d013eb173cd505057663e2f9593e1217)
+++ src/version.h	(revision 0ac96909135fb8494d1d6c2f4ebb9566aa236566)
@@ -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
 
