diff options
| author | Tannin <devnull@localhost> | 2015-01-24 19:34:12 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-01-24 19:34:12 +0100 |
| commit | c3a95bdef1d989a54684b966e042b12bf682046d (patch) | |
| tree | 83a09ca9252b9d5a060acb415b8c3c0923cfe2c3 /src/modlistsortproxy.cpp | |
| parent | 9edc39633b82b5e02d33c4b0a395fe110af28eb4 (diff) | |
| parent | f756aede08edb315ebe5882098191ebfe971fd81 (diff) | |
Merge with branch1.2
Diffstat (limited to 'src/modlistsortproxy.cpp')
| -rw-r--r-- | src/modlistsortproxy.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 6c24be98..9eeb3439 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -20,12 +20,12 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "modlistsortproxy.h"
#include "modinfo.h"
#include "profile.h"
-#include "modlist.h"
#include "messagedialog.h"
#include <QMenu>
#include <QCheckBox>
#include <QWidgetAction>
#include <QApplication>
+#include <QMimeData>
#include <QDebug>
#include <QTreeView>
@@ -347,23 +347,23 @@ bool ModListSortProxy::filterAcceptsRow(int row, const QModelIndex &parent) cons bool ModListSortProxy::dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent)
{
- if (sortColumn() != ModList::COL_PRIORITY) {
- QWidget *wid = qApp->activeWindow()->findChild<QTreeView*>("modList");
- MessageDialog::showMessage(tr("Drag&Drop is only supported when sorting by priority"), wid);
- return false;
- }
- if ((row == -1) && (column == -1)) {
- return this->sourceModel()->dropMimeData(data, action, -1, -1, mapToSource(parent));
- }
- // in the regular model, when dropping between rows, the row-value passed to
- // the sourceModel is inconsistent between ascending and descending ordering.
- // This should fix that
- if (sortOrder() == Qt::DescendingOrder) {
- --row;
- }
+ if (!data->hasUrls() && (sortColumn() != ModList::COL_PRIORITY)) {
+ QWidget *wid = qApp->activeWindow()->findChild<QTreeView*>("modList");
+ MessageDialog::showMessage(tr("Drag&Drop is only supported when sorting by priority"), wid);
+ return false;
+ }
+ if ((row == -1) && (column == -1)) {
+ return this->sourceModel()->dropMimeData(data, action, -1, -1, mapToSource(parent));
+ }
+ // in the regular model, when dropping between rows, the row-value passed to
+ // the sourceModel is inconsistent between ascending and descending ordering.
+ // This should fix that
+ if (sortOrder() == Qt::DescendingOrder) {
+ --row;
+ }
- QModelIndex proxyIndex = index(row, column, parent);
- QModelIndex sourceIndex = mapToSource(proxyIndex);
- return this->sourceModel()->dropMimeData(data, action, sourceIndex.row(), sourceIndex.column(),
- sourceIndex.parent());
+ QModelIndex proxyIndex = index(row, column, parent);
+ QModelIndex sourceIndex = mapToSource(proxyIndex);
+ return this->sourceModel()->dropMimeData(data, action, sourceIndex.row(), sourceIndex.column(),
+ sourceIndex.parent());
}
|
