changeset 383:1affc7820bef

Strip trailing slash before adding to recent files
author Chris Cannam
date Thu, 19 May 2011 09:25:54 +0100
parents f7dc2c5d8650
children 2925975bdc9e
files src/recentfiles.cpp
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/recentfiles.cpp	Thu May 19 09:14:12 2011 +0100
+++ b/src/recentfiles.cpp	Thu May 19 09:25:54 2011 +0100
@@ -122,6 +122,12 @@
 {
     static QRegExp schemeRE("^[a-zA-Z]{2,5}://");
     static QRegExp tempRE("[\\/][Tt]e?mp[\\/]");
+    if (name.endsWith("/")) {
+        name = name.left(name.length()-1);
+    }
+    if (name == "") {
+        return;
+    }
     if (schemeRE.indexIn(name) == 0) {
         add(name);
     } else {