From d1e1136cf4ec3b3cd52d27e704a06edb33bc8229 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <helling@atdotde.de>
Date: Sat, 2 Aug 2014 22:52:46 +0200
Subject: [PATCH] In recent files use native directory separators

Qt internally always uses / as directory separator. #651 shows that in the recent
files menu, under windows we can have double entries with both versions of the
separator. This patch should normalize the menu entires to use the native separator
(i.e. \ on Windows). (Untested due to lack of Windows computer).

Refs #651

Signed-off-by: Robert C. Helling <helling@atdotde.de>
---
 qt-ui/mainwindow.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 9571f0d..aa9d8c1 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -972,7 +972,7 @@ void MainWindow::addRecentFile(const QStringList &newFiles)
 	}
 
 	foreach (const QString &file, newFiles) {
-		int index = files.indexOf(file);
+		int index = files.indexOf(QDir::toNativeSeparators(file));
 
 		if (index >= 0) {
 			files.removeAt(index);
@@ -981,7 +981,7 @@ void MainWindow::addRecentFile(const QStringList &newFiles)
 
 	foreach (const QString &file, newFiles) {
 		if (QFile::exists(file)) {
-			files.prepend(file);
+			files.prepend(QDir::toNativeSeparators(file));
 		}
 	}
 
-- 
1.8.5.2 (Apple Git-48)

