mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-28 22:09:40 +00:00
Content selector: drop duplicates of the added file (bug #2395)
This commit is contained in:
parent
58f8d1ac04
commit
ebe5448816
2 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
------
|
------
|
||||||
|
|
||||||
Bug #1515: Opening console masks dialogue, inventory menu
|
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 #2969: Scripted items can stack
|
||||||
Bug #2987: Editor: some chance and AI data fields can overflow
|
Bug #2987: Editor: some chance and AI data fields can overflow
|
||||||
Bug #3006: 'else if' operator breaks script compilation
|
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)
|
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());
|
beginInsertRows(QModelIndex(), mFiles.count(), mFiles.count());
|
||||||
mFiles.append(file);
|
mFiles.append(file);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
Loading…
Reference in a new issue