From ec9dafe2f01eb0be040bc3a89f9fc9e4d21bbac5 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 30 Jan 2020 18:15:51 +0200 Subject: BookmarkModel: enable drag/drop for the root item --- lib/bookmarks/bookmarkmodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1