Content selector: drop duplicates of the added file (bug #2395)

pull/2391/head
Capostrophic 6 years ago
parent 58f8d1ac04
commit ebe5448816

@ -2,6 +2,7 @@
------
Bug #1515: Opening console masks dialogue, inventory menu
Bug #2395: Duplicated plugins in the launcher when multiple data directories provide the same plugin
Bug #2969: Scripted items can stack
Bug #2987: Editor: some chance and AI data fields can overflow
Bug #3006: 'else if' operator breaks script compilation

@ -408,6 +408,17 @@ bool ContentSelectorModel::ContentModel::dropMimeData(const QMimeData *data, Qt:
void ContentSelectorModel::ContentModel::addFile(EsmFile *file)
{
for (int row = 0; row < mFiles.size(); row++)
{
if (mFiles.at(row)->fileName() == file->fileName())
{
beginRemoveRows(QModelIndex(), row, row);
mFiles.removeAt(row);
endRemoveRows();
emit dataChanged(index(row, 0), index(mFiles.size(), 0));
break;
}
}
beginInsertRows(QModelIndex(), mFiles.count(), mFiles.count());
mFiles.append(file);
endInsertRows();

Loading…
Cancel
Save