fix dropping groups beyond end of group list

The issue was that the end-of-list drop zone is quite small
    and groups were being dropped outside of the bounds of the mapList
This commit is contained in:
garak 2025-02-22 15:52:04 -05:00 committed by t
parent 29f88e6b76
commit 632eeef53f

View File

@ -277,6 +277,11 @@ bool MapGroupModel::dropMimeData(const QMimeData *data, Qt::DropAction action, i
if (parentIndex.row() != -1 || parentIndex.column() != -1) {
return false;
}
if (row < 0) {
row = this->rowCount(parentIndex);
}
QByteArray encodedData = data->data("application/porymap.mapgroupmodel.group");
QDataStream stream(&encodedData, QIODevice::ReadOnly);
QString groupName;
@ -296,7 +301,6 @@ bool MapGroupModel::dropMimeData(const QMimeData *data, Qt::DropAction action, i
}
this->insertRow(row, parentIndex);
QModelIndex groupIndex = index(row, 0, parentIndex);
QStandardItem *groupItem = this->itemFromIndex(groupIndex);
createMapFolderItem(groupName, groupItem);