From 0fcb75fb213f33107271fea26f712a6828d1ac9c Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Wed, 22 May 2019 20:55:30 +0300 Subject: [PATCH] Achieve CHIM and get rid of the loop --- components/contentselector/model/contentmodel.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index 6ac074b4d..390dde223 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -408,12 +408,6 @@ 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().compare(file->fileName(), Qt::CaseInsensitive)) - return; - } - beginInsertRows(QModelIndex(), mFiles.count(), mFiles.count()); mFiles.append(file); endInsertRows(); @@ -434,7 +428,7 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path) { QFileInfo info(dir.absoluteFilePath(path2)); - if (item(info.absoluteFilePath()) != 0) + if (item(info.fileName())) continue; try {