mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-30 09:41:31 +00:00
Fix out-of-bounds index dataChanged calls
This commit is contained in:
parent
6d97ea01b2
commit
54eea09a9e
2 changed files with 5 additions and 5 deletions
|
@ -726,7 +726,7 @@ void ContentSelectorModel::ContentModel::setContentList(const QStringList& fileL
|
|||
}
|
||||
}
|
||||
}
|
||||
emit dataChanged(index(0, 0), index(rowCount(), columnCount()));
|
||||
refreshModel();
|
||||
}
|
||||
|
||||
QList<ContentSelectorModel::LoadOrderError> ContentSelectorModel::ContentModel::checkForLoadOrderErrors(
|
||||
|
@ -790,9 +790,9 @@ QString ContentSelectorModel::ContentModel::toolTip(const EsmFile* file) const
|
|||
}
|
||||
}
|
||||
|
||||
void ContentSelectorModel::ContentModel::refreshModel()
|
||||
void ContentSelectorModel::ContentModel::refreshModel(std::initializer_list<int> roles)
|
||||
{
|
||||
emit dataChanged(index(0, 0), index(rowCount() - 1, 0));
|
||||
emit dataChanged(index(0, 0), index(rowCount() - 1, 0), roles);
|
||||
}
|
||||
|
||||
bool ContentSelectorModel::ContentModel::setCheckState(const QString& filepath, bool checkState)
|
||||
|
@ -878,5 +878,5 @@ ContentSelectorModel::ContentFileList ContentSelectorModel::ContentModel::checke
|
|||
void ContentSelectorModel::ContentModel::uncheckAll()
|
||||
{
|
||||
mCheckedFiles.clear();
|
||||
emit dataChanged(index(0, 0), index(rowCount(), columnCount()), { Qt::CheckStateRole, Qt::UserRole + 1 });
|
||||
refreshModel({ Qt::CheckStateRole, Qt::UserRole + 1 });
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace ContentSelectorModel
|
|||
ContentFileList checkedItems() const;
|
||||
void uncheckAll();
|
||||
|
||||
void refreshModel();
|
||||
void refreshModel(std::initializer_list<int> roles = {});
|
||||
|
||||
private:
|
||||
void addFile(EsmFile* file);
|
||||
|
|
Loading…
Reference in a new issue