Index: trunk/src/defaults.h
===================================================================
--- trunk/src/defaults.h	(revision 127)
+++ trunk/src/defaults.h	(revision 128)
@@ -36,4 +36,6 @@
 //! Default for "Automatically resize rows and columns to their contents"
 #define DEF_AUTOSIZE true
+//! Default for "Remember last used directories"
+#define DEF_SAVE_LAST_USED true
 /*!
  * \def DEF_USE_NATIVE_DIALOGS
Index: trunk/src/mainwindow.cpp
===================================================================
--- trunk/src/mainwindow.cpp	(revision 127)
+++ trunk/src/mainwindow.cpp	(revision 128)
@@ -158,9 +158,16 @@
 	filters.append(tr("All Files") + " (*)");
 
-QString file = QFileInfo(fileName).canonicalPath();
+QString file;
+	if ((fileName == tr("Untitled") + ".tspt") && settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
+		file = settings->value("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("LastUsed/TaskLoadPath", QFileInfo(file).path());
+
 	if (!tspmodel->loadTask(file))
 		return;
@@ -174,5 +181,5 @@
 bool MainWindow::actionFileSaveTriggered()
 {
-	if ((fileName == tr("Untitled") + ".tspt") || (!fileName.endsWith(".tspt", Qt::CaseInsensitive)))
+	if ((fileName == tr("Untitled") + ".tspt") || !fileName.endsWith(".tspt", Qt::CaseInsensitive))
 		return saveTask();
 	else
@@ -192,10 +199,12 @@
 {
 static QString selectedFile;
-	if (selectedFile.isEmpty())
-		selectedFile = QFileInfo(fileName).canonicalPath();
-	else
-		selectedFile = QFileInfo(selectedFile).canonicalPath();
+	if (selectedFile.isEmpty()) {
+		if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) {
+			selectedFile = settings->value("LastUsed/SolutionSavePath").toString();
+		}
+	} else
+		selectedFile = QFileInfo(selectedFile).path();
 	if (!selectedFile.isEmpty())
-		selectedFile += "/";
+		selectedFile.append("/");
 	if (fileName == tr("Untitled") + ".tspt") {
 #ifndef QT_NO_PRINTER
@@ -227,4 +236,6 @@
 		return;
 	selectedFile = file;
+	if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool())
+		settings->setValue("LastUsed/SolutionSavePath", QFileInfo(selectedFile).path());
 	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 #ifndef QT_NO_PRINTER
@@ -1432,14 +1443,21 @@
 	filters.append(tr("All Files") + " (*)");
 QString file;
-	if (fileName.endsWith(".tspt", Qt::CaseInsensitive))
+	if ((fileName == tr("Untitled") + ".tspt") && settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) {
+		file = settings->value("LastUsed/TaskSavePath").toString();
+		if (!file.isEmpty())
+			file.append("/");
+		file.append(fileName);
+	} else if (fileName.endsWith(".tspt", Qt::CaseInsensitive))
 		file = fileName;
 	else
-		file = QFileInfo(fileName).canonicalPath() + "/" + QFileInfo(fileName).completeBaseName() + ".tspt";
+		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("LastUsed/TaskSavePath", QFileInfo(file).path());
+
 	if (tspmodel->saveTask(file)) {
 		setFileName(file);
Index: trunk/src/settingsdialog.cpp
===================================================================
--- trunk/src/settingsdialog.cpp	(revision 127)
+++ trunk/src/settingsdialog.cpp	(revision 128)
@@ -200,4 +200,5 @@
 
 	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_OS_WIN32
@@ -310,7 +311,7 @@
 			return;
 	}
-#ifndef HANDHELD
-	settings->setValue("SavePos", cbSaveState->isChecked());
-#endif // HANDHELD
+	settings->setValue("Autosize", cbAutosize->isChecked());
+	settings->setValue("SaveLastUsed", cbSaveLastUsed->isChecked());
+	settings->setValue("UseNativeDialogs", cbUseNativeDialogs->isChecked());
 #ifdef Q_OS_WIN32
 	if (QtWin::isCompositionEnabled()) {
@@ -323,6 +324,7 @@
 	}
 #endif // Q_OS_WIN32
-	settings->setValue("Autosize", cbAutosize->isChecked());
-	settings->setValue("UseNativeDialogs", cbUseNativeDialogs->isChecked());
+#ifndef HANDHELD
+	settings->setValue("SavePos", cbSaveState->isChecked());
+#endif // HANDHELD
 
 	settings->beginGroup("Task");
