| 1063 | } |
| 1064 | |
| 1065 | bool ModList::canDropMimeData(const QMimeData* mimeData, Qt::DropAction action, int row, |
| 1066 | int column, const QModelIndex& parent) const |
| 1067 | { |
| 1068 | if (action == Qt::IgnoreAction) { |
| 1069 | return false; |
| 1070 | } |
| 1071 | |
| 1072 | ModListDropInfo dropInfo(mimeData, *m_Organizer); |
| 1073 | |
| 1074 | if (dropInfo.isLocalFileDrop()) { |
| 1075 | if (row == -1 && parent.isValid()) { |
| 1076 | ModInfo::Ptr modInfo = ModInfo::getByIndex(parent.row()); |
| 1077 | return modInfo->isRegular() && !modInfo->isSeparator(); |
| 1078 | } |
| 1079 | } else if (dropInfo.isValid()) { |
| 1080 | // drop on item |
| 1081 | if (row == -1 && parent.isValid()) { |
| 1082 | return true; |
| 1083 | } else if (hasIndex(row, column, parent)) { |
| 1084 | ModInfo::Ptr modInfo = ModInfo::getByIndex(row); |
| 1085 | return !modInfo->isBackup() && (modInfo->isSeparator() || !parent.isValid()); |
| 1086 | } else { |
| 1087 | return true; |
| 1088 | } |
| 1089 | } |
| 1090 | |
| 1091 | return false; |
| 1092 | } |
| 1093 | |
| 1094 | bool ModList::dropMimeData(const QMimeData* mimeData, Qt::DropAction action, int row, |
| 1095 | int, const QModelIndex& parent) |
nothing calls this directly
no test coverage detected