┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.cpp
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2023-05-08 17:46:51 +0200
committerMéven Car <[email protected]>2023-05-08 17:46:51 +0200
commit863ee3a87cee8b1f22a311d6a6a62e56714b5eae (patch)
tree728a2f70486e1835053e5c3431e72c62eb69ff82 /src/kitemviews/kfileitemmodel.cpp
parent69f6b9b78b71f8369dc0ab9b9f9aecfd928d3eb1 (diff)
parent26808a188ccb5e35a05b37709e4fe61263c46032 (diff)
Merge branch 'master' into kf6
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index c7b3af76b..ebcd4b912 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -324,8 +324,13 @@ int KFileItemModel::indexForKeyboardSearch(const QString &text, int startFromInd
bool KFileItemModel::supportsDropping(int index) const
{
- const KFileItem item = fileItem(index);
- return !item.isNull() && (item.isDir() || item.isDesktopFile());
+ KFileItem item;
+ if (index == -1) {
+ item = rootItem();
+ } else {
+ item = fileItem(index);
+ }
+ return !item.isNull() && ((item.isDir() && item.isWritable()) || item.isDesktopFile());
}
QString KFileItemModel::roleDescription(const QByteArray &role) const