From 8cf429a1dd0d99790f2564b3ad363788e224711a Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 5 Aug 2015 22:48:34 +0200 Subject: - bugfix: manual installer now cancels drag&drop when dropping on a subitem - bugfix: objects dropped on the modlist were treated as mods when they weren't urls --- src/modlist.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 59bd8979..fa34004d 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -587,6 +587,12 @@ QStringList ModList::mimeTypes() const return result; } +QMimeData *ModList::mimeData(const QModelIndexList &indexes) const +{ + QMimeData *result = QAbstractItemModel::mimeData(indexes); + result->setData("text/plain", "mod"); + return result; +} void ModList::changeModPriority(std::vector sourceIndices, int newPriority) { @@ -824,7 +830,6 @@ bool ModList::dropURLs(const QMimeData *mimeData, int row, const QModelIndex &pa return true; } - bool ModList::dropMod(const QMimeData *mimeData, int row, const QModelIndex &parent) { @@ -877,9 +882,10 @@ bool ModList::dropMimeData(const QMimeData *mimeData, Qt::DropAction action, int } if (m_Profile == nullptr) return false; + if (mimeData->hasUrls()) { return dropURLs(mimeData, row, parent); - } else { + } else if (mimeData->hasText()) { return dropMod(mimeData, row, parent); } } @@ -1141,3 +1147,4 @@ bool ModList::eventFilter(QObject *obj, QEvent *event) } return QAbstractItemModel::eventFilter(obj, event); } + -- cgit v1.3.1