summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChinmoy Ranjan Pradhan <[email protected]>2017-01-09 18:26:00 +0530
committerChinmoy Ranjan Pradhan <[email protected]>2017-01-09 19:06:46 +0530
commit23cff2bf352160e085b161959146375b7db7ad5d (patch)
tree36cb11bc0854fa314ab08decbd29dc2f76c3c87d
parent3b9897ca360e28e95798c940bf93f711c60245f0 (diff)
[Folder View] Fix CD in "Link" type desktop files
When in folder view(placed in panel) location is set to Desktop(desktop:/), clicking on a desktop file of "Link" type should change to the pointed directory. Differential Revision: https://phabricator.kde.org/D3927
-rw-r--r--containments/desktop/plugins/folder/foldermodel.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp
index 424a7f2..8e5751a 100644
--- a/containments/desktop/plugins/folder/foldermodel.cpp
+++ b/containments/desktop/plugins/folder/foldermodel.cpp
@@ -492,10 +492,20 @@ void FolderModel::cd(int row)
return;
}
- KFileItem item = itemForIndex(index(row, 0));
+ const QModelIndex idx = index(row, 0);
+ bool isDir = data(idx, IsDirRole).toBool();
- if (item.isDir()) {
- setUrl(item.url().toString());
+ if (isDir) {
+ const KFileItem item = itemForIndex(idx);
+ if (m_parseDesktopFiles && item.isDesktopFile()) {
+ const KDesktopFile file(item.targetUrl().path());
+ if (file.readType() == QLatin1String("Link")) {
+ setUrl(file.readUrl());
+ }
+ }
+ else {
+ setUrl(item.url().toString());
+ }
}
}