diff --git a/CHANGELOG.md b/CHANGELOG.md index c5c6a08853..3658b839a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index 7a4558d57a..ef27f938d2 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -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();