From bafcf93eb157760e510c7dcb2fa889e1032e7e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 31 Jul 2019 01:27:35 +0200 Subject: NOISSUE fix bug with drag & drop not working with empty mod list --- api/logic/minecraft/SimpleModList.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/api/logic/minecraft/SimpleModList.cpp b/api/logic/minecraft/SimpleModList.cpp index bdcf01b7..39f5565d 100644 --- a/api/logic/minecraft/SimpleModList.cpp +++ b/api/logic/minecraft/SimpleModList.cpp @@ -337,13 +337,14 @@ Qt::ItemFlags SimpleModList::flags(const QModelIndex &index) const { Qt::ItemFlags defaultFlags = QAbstractListModel::flags(index); auto flags = defaultFlags; - if(index.isValid()) { - if(interaction_disabled) { - flags &= ~Qt::ItemIsDropEnabled; - flags &= ~Qt::ItemIsUserCheckable; - } else { + if(interaction_disabled) { + flags &= ~Qt::ItemIsDropEnabled; + } + else + { + flags |= Qt::ItemIsDropEnabled; + if(index.isValid()) { flags |= Qt::ItemIsUserCheckable; - flags |= Qt::ItemIsDropEnabled; } } return flags; -- cgit v1.2.3