Commit 6b8fa112 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Folder View] Fix supported drag actions

SetSupportedDragActions is deprecated and doesn't seem to work.
This fixes modifier shortcuts for dragging, e.g. dragging with Ctrl+Shift to create a link.

BUG: 382797
FIXED-IN: 5.11.0

Differential Revision:
parent 4bf0358a
......@@ -150,8 +150,6 @@ FolderModel::FolderModel(QObject *parent) : QSortFilterProxyModel(parent),
sort(m_sortMode, m_sortDesc ? Qt::DescendingOrder : Qt::AscendingOrder);
setSupportedDragActions(Qt::CopyAction | Qt::MoveAction | Qt::LinkAction);
......@@ -1248,6 +1246,11 @@ bool FolderModel::lessThan(const QModelIndex &left, const QModelIndex &right) co
return QString::compare(leftItem.url().url(), rightItem.url().url(), Qt::CaseSensitive);
Qt::DropActions FolderModel::supportedDragActions() const
return Qt::CopyAction | Qt::MoveAction | Qt::LinkAction;
inline bool FolderModel::matchMimeType(const KFileItem &item) const
if (m_mimeSet.isEmpty()) {
......@@ -221,6 +221,7 @@ class FolderModel : public QSortFilterProxyModel
KFileItem itemForIndex(const QModelIndex &index) const;
bool isDir(const QModelIndex &index, const KDirModel *dirModel) const;
bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE;
Qt::DropActions supportedDragActions() const override;
Q_INVOKABLE void paste();
Q_INVOKABLE void copy();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment