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

Method canDropMimeData

src/modlist.cpp:1065–1092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1063}
1064
1065bool 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
1094bool ModList::dropMimeData(const QMimeData* mimeData, Qt::DropAction action, int row,
1095 int, const QModelIndex& parent)

Callers

nothing calls this directly

Calls 5

isLocalFileDropMethod · 0.80
isValidMethod · 0.45
isRegularMethod · 0.45
isSeparatorMethod · 0.45
isBackupMethod · 0.45

Tested by

no test coverage detected