summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/SimpleModList.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-07-31 01:27:35 +0200
committerPetr Mrázek <peterix@gmail.com>2019-07-31 01:27:35 +0200
commitbafcf93eb157760e510c7dcb2fa889e1032e7e39 (patch)
treecac47b8d5b4f09374dc60c1e05db704148fd101b /api/logic/minecraft/SimpleModList.cpp
parentbd93c3b4e045c0a5e4ce0a7f840a86716037bf0a (diff)
downloadMultiMC-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
Diffstat (limited to 'api/logic/minecraft/SimpleModList.cpp')
-rw-r--r--api/logic/minecraft/SimpleModList.cpp13
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;