aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-01-30 18:15:51 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-01-30 18:15:51 +0200
commitec9dafe2f01eb0be040bc3a89f9fc9e4d21bbac5 (patch)
treea53cbd340bfe473fa3b2a1d36cfb35ee6fcd7824 /lib
parentBookmarksWidget: add Clear selection in context menu (diff)
downloadsmolbote-ec9dafe2f01eb0be040bc3a89f9fc9e4d21bbac5.tar.xz
BookmarkModel: enable drag/drop for the root item
Diffstat (limited to 'lib')
-rw-r--r--lib/bookmarks/bookmarkmodel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bookmarks/bookmarkmodel.cpp b/lib/bookmarks/bookmarkmodel.cpp
index 05df3d7..8599f1d 100644
--- a/lib/bookmarks/bookmarkmodel.cpp
+++ b/lib/bookmarks/bookmarkmodel.cpp
@@ -95,7 +95,8 @@ bool BookmarkModel::setData(const QModelIndex &index, const QVariant &value, Boo
Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const
{
- if(getItem(index)->type() == BookmarkItem::Folder)
+ const auto type = getItem(index)->type();
+ if(type == BookmarkItem::Folder || type == BookmarkItem::Root)
return QAbstractItemModel::flags(index) | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
else
return QAbstractItemModel::flags(index) | Qt::ItemIsDragEnabled | Qt::ItemNeverHasChildren;