┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Heidelbach <[email protected]>2018-01-03 14:05:58 +0100
committerElvis Angelaccio <[email protected]>2018-01-03 14:07:11 +0100
commit7b595b3387cdb002c3e9a11e98a95d8801ca078d (patch)
tree605224aad4c9988fe79c178e9198f2ca77e83a60 /src
parent9d3a019445d7a7fdf3177bca9eeef4c44599e706 (diff)
Revive folderpanel when outside $HOME
Summary: Currently the folderpanel is inert when browsing outside of home because urls end up as 'file:////a/b/c' and since Qt 5.10 this is an invalid URL: http://code.qt.io/cgit/qt/qtbase.git/commit/?id=f62768d046528636789f901ac79e2cfa1843a7b7 Premptive bug fix. Test Plan: Open dolphin Leave home directory Reviewers: #dolphin, elvisangelaccio Subscribers: dfaure, elvisangelaccio, ngraham, anthonyfieroni Tags: #dolphin Differential Revision: https://phabricator.kde.org/D9610
Diffstat (limited to 'src')
-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 8f89b89df..5919e6427 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);
}