diff options
author | Petr Mrázek <peterix@gmail.com> | 2019-07-31 01:27:35 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2019-07-31 01:27:35 +0200 |
commit | bafcf93eb157760e510c7dcb2fa889e1032e7e39 (patch) | |
tree | cac47b8d5b4f09374dc60c1e05db704148fd101b | |
parent | bd93c3b4e045c0a5e4ce0a7f840a86716037bf0a (diff) | |
download | MultiMC-bafcf93eb157760e510c7dcb2fa889e1032e7e39.tar MultiMC-bafcf93eb157760e510c7dcb2fa889e1032e7e39.tar.gz MultiMC-bafcf93eb157760e510c7dcb2fa889e1032e7e39.tar.lz MultiMC-bafcf93eb157760e510c7dcb2fa889e1032e7e39.tar.xz MultiMC-bafcf93eb157760e510c7dcb2fa889e1032e7e39.zip |
NOISSUE fix bug with drag & drop not working with empty mod list
-rw-r--r-- | api/logic/minecraft/SimpleModList.cpp | 13 |
1 files 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; |