MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / canDropMimeData

Method canDropMimeData

src/modlistsortproxy.cpp:591–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591bool 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
620bool ModListSortProxy::dropMimeData(const QMimeData* data, Qt::DropAction action,
621 int row, int column, const QModelIndex& parent)

Callers

nothing calls this directly

Calls 2

isLocalFileDropMethod · 0.80
isDownloadDropMethod · 0.80

Tested by

no test coverage detected