diff options
author | kh <qtc-committer@nokia.com> | 2009-06-18 11:15:41 (GMT) |
---|---|---|
committer | kh <qtc-committer@nokia.com> | 2009-06-18 11:15:41 (GMT) |
commit | 88130cb56b0b1b7332430d6045946635ca1c8c75 (patch) | |
tree | 42d149ad1e73bc27369110479207bc05cd33a3dc /tools/assistant | |
parent | 472ab7c60a6ede66565166fa21d6642a918f7403 (diff) | |
download | Qt-88130cb56b0b1b7332430d6045946635ca1c8c75.zip Qt-88130cb56b0b1b7332430d6045946635ca1c8c75.tar.gz Qt-88130cb56b0b1b7332430d6045946635ca1c8c75.tar.bz2 |
Make it possible to drag bookmarks to the root item.
Reviewed-by: kh
Diffstat (limited to 'tools/assistant')
-rw-r--r-- | tools/assistant/tools/assistant/bookmarkmanager.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; |