From a7eb316b1f8270500f608293cc40c29fde3056dc Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sat, 2 Aug 2014 22:52:46 +0200 Subject: 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). See #651 Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index bbee51b8b..fece00848 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -970,7 +970,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); @@ -979,7 +979,7 @@ void MainWindow::addRecentFile(const QStringList &newFiles) foreach (const QString &file, newFiles) { if (QFile::exists(file)) { - files.prepend(file); + files.prepend(QDir::toNativeSeparators(file)); } } -- cgit v1.2.3-70-g09d2