From 88130cb56b0b1b7332430d6045946635ca1c8c75 Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 18 Jun 2009 13:15:41 +0200 Subject: Make it possible to drag bookmarks to the root item. Reviewed-by: kh --- tools/assistant/tools/assistant/bookmarkmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 336c856..3bca573 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -606,7 +606,8 @@ Qt::DropActions BookmarkModel::supportedDropActions() const Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const { Qt::ItemFlags defaultFlags = QStandardItemModel::flags(index); - if (index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) + if ((!index.isValid()) // can only happen for the invisible root item + || index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) return (Qt::ItemIsDropEnabled | defaultFlags) &~ Qt::ItemIsDragEnabled; return (Qt::ItemIsDragEnabled | defaultFlags) &~ Qt::ItemIsDropEnabled; -- cgit v0.12