aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Neundorf <[email protected]>2017-09-15 22:15:29 +0200
committerAlex Neundorf <[email protected]>2017-09-15 22:18:24 +0200
commite2d5c00eabea96fdd91890e57a7595a9286c650f (patch)
treeb82c63a814726909aabe4a5ae55bce23e0e06a75
parent885631dc303182b4997c4f6cdc5018265c3b055c (diff)
-make "Gp up" work after "Current document folder"
The QUrl already ends with a slash, and appending another slash somehow breaks the up-action of KDirOperator. Not sure whether the test endsWith() is necessary, or whether the slash simply never has to be appended. Alex
-rw-r--r--addons/filebrowser/katefilebrowser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/filebrowser/katefilebrowser.cpp b/addons/filebrowser/katefilebrowser.cpp
index 75741b5..2d3dbac 100644
--- a/addons/filebrowser/katefilebrowser.cpp
+++ b/addons/filebrowser/katefilebrowser.cpp
@@ -206,7 +206,10 @@ void KateFileBrowser::setDir(QUrl u)
else
newurl = u;
- newurl.setPath(newurl.path() + QLatin1Char('/'));
+ QString path(newurl.path());
+ if (!path.endsWith(QLatin1Char('/')))
+ path += QLatin1Char('/');
+ newurl.setPath(path);
if (!kateFileSelectorIsReadable(newurl)) {
newurl.setPath(newurl.path() + QStringLiteral("../"));