diff options
| author | Akseli Lahtinen <[email protected]> | 2024-03-08 11:37:20 +0000 |
|---|---|---|
| committer | Akseli Lahtinen <[email protected]> | 2024-03-08 11:37:20 +0000 |
| commit | 803bbd1ae191a89ffdb3889acb6621431525f96d (patch) | |
| tree | 9d0e7fedf8326c7a73d1376eb5e10e8d20aea67b /src/kitemviews/kfileitemmodel.cpp | |
| parent | 599ddb3c0dcfa1d676653de72caa238f8fce6d49 (diff) | |
Start autoActivationTimer only if hovering over a directory
Before starting autoActivationTimer, check that we're hovering the item on top of a directory.
If we don't check for it, the the autoActivationTimer will try to open the hovered item
in it's default application, which can be distracting and break the actual action
the user was trying to do, like moving the file to a directory.
BUG:479960
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 9ef66d6b8..c694da9f2 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -352,6 +352,17 @@ bool KFileItemModel::supportsDropping(int index) const return !item.isNull() && DragAndDropHelper::supportsDropping(item); } +bool KFileItemModel::canEnterOnHover(int index) const +{ + KFileItem item; + if (index == -1) { + item = rootItem(); + } else { + item = fileItem(index); + } + return !item.isNull() && (item.isDir() || item.isDesktopFile()); +} + QString KFileItemModel::roleDescription(const QByteArray &role) const { static QHash<QByteArray, QString> description; |
