┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
diff options
context:
space:
mode:
authorLuca Beltrame <[email protected]>2018-01-18 09:09:49 +0100
committerLuca Beltrame <[email protected]>2018-01-18 09:09:49 +0100
commit1a6b3c0a2baba955259d6083c0a3f25dfb44a682 (patch)
treec2a1dae6bb4a2a55cbb50206498951140e252318 /src/kitemviews
parentdedb612764cfa747ff3ff339323c15cd1fea6925 (diff)
parent64d2fd29819fa46c293e8c726c7df2ff00b332b3 (diff)
Merge remote-tracking branch 'origin/Applications/17.12'
Conflicts: CMakeLists.txt [versions] src/panels/places/placesitemmodel.cpp
Diffstat (limited to 'src/kitemviews')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 634e70399..3947d3707 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -629,20 +629,24 @@ void KFileItemModel::restoreExpandedDirectories(const QSet<QUrl> &urls)
void KFileItemModel::expandParentDirectories(const QUrl &url)
{
- const int pos = m_dirLister->url().path().length();
// Assure that each sub-path of the URL that should be
// expanded is added to m_urlsToExpand. KDirLister
// does not care whether the parent-URL has already been
// expanded.
QUrl urlToExpand = m_dirLister->url();
+ const int pos = urlToExpand.path().length();
// first subdir can be empty, if m_dirLister->url().path() does not end with '/'
// this happens if baseUrl is not root but a home directory, see FoldersPanel,
// so using QString::SkipEmptyParts
const QStringList subDirs = url.path().mid(pos).split(QDir::separator(), QString::SkipEmptyParts);
for (int i = 0; i < subDirs.count() - 1; ++i) {
- urlToExpand.setPath(urlToExpand.path() + '/' + subDirs.at(i));
+ QString path = urlToExpand.path();
+ if (!path.endsWith(QLatin1Char('/'))) {
+ path.append(QLatin1Char('/'));
+ }
+ urlToExpand.setPath(path + subDirs.at(i));
m_urlsToExpand.insert(urlToExpand);
}