Fix error when create new OpenCS addon

pull/2138/head
Alexander Kolodeev 6 years ago
parent 10a049b087
commit 7c3ef213ce

@ -474,10 +474,14 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path)
void ContentSelectorModel::ContentModel::clearFiles() void ContentSelectorModel::ContentModel::clearFiles()
{ {
beginRemoveRows(QModelIndex(), 0, mFiles.count()-1); const int filesCount = mFiles.count();
if (filesCount > 0) {
beginRemoveRows(QModelIndex(), 0, filesCount - 1);
mFiles.clear(); mFiles.clear();
endRemoveRows(); endRemoveRows();
} }
}
QStringList ContentSelectorModel::ContentModel::gameFiles() const QStringList ContentSelectorModel::ContentModel::gameFiles() const
{ {

Loading…
Cancel
Save