| 589 | } |
| 590 | |
| 591 | bool ModListSortProxy::canDropMimeData(const QMimeData* data, Qt::DropAction action, |
| 592 | int row, int column, |
| 593 | const QModelIndex& parent) const |
| 594 | { |
| 595 | ModListDropInfo dropInfo(data, *m_Organizer); |
| 596 | |
| 597 | if (!dropInfo.isLocalFileDrop() && sortColumn() != ModList::COL_PRIORITY) { |
| 598 | return false; |
| 599 | } |
| 600 | |
| 601 | // disable drop install with group proxy, except the one for collapsible separator |
| 602 | // - it would be nice to be able to "install to category" or something like that but |
| 603 | // it's a bit more complicated since the drop position is based on the category, so |
| 604 | // just disabling for now |
| 605 | if (dropInfo.isDownloadDrop()) { |
| 606 | // maybe there is a cleaner way? |
| 607 | if (qobject_cast<QtGroupingProxy*>(sourceModel())) { |
| 608 | return false; |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | // see dropMimeData for details |
| 613 | if (sortOrder() == Qt::DescendingOrder && row != -1 && !sourceIsByPriorityProxy()) { |
| 614 | --row; |
| 615 | } |
| 616 | |
| 617 | return QSortFilterProxyModel::canDropMimeData(data, action, row, column, parent); |
| 618 | } |
| 619 | |
| 620 | bool ModListSortProxy::dropMimeData(const QMimeData* data, Qt::DropAction action, |
| 621 | int row, int column, const QModelIndex& parent) |
nothing calls this directly
no test coverage detected