Enable warnings as errors (#5101)

This commit is contained in:
Seth Flynn 2026-03-06 07:42:39 +00:00 committed by GitHub
commit 352b98db8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 112 additions and 272 deletions

View file

@ -153,13 +153,13 @@ QStringList InstanceList::getLinkedInstancesById(const QString& id) const
int InstanceList::rowCount(const QModelIndex& parent) const
{
Q_UNUSED(parent);
return m_instances.size();
return count();
}
QModelIndex InstanceList::index(int row, int column, const QModelIndex& parent) const
{
Q_UNUSED(parent);
if (row < 0 || static_cast<std::size_t>(row) >= m_instances.size())
if (row < 0 || row >= count())
return QModelIndex();
return createIndex(row, column, m_instances.at(row).get());
}
@ -579,7 +579,7 @@ void InstanceList::saveNow()
void InstanceList::add(std::vector<std::unique_ptr<BaseInstance>>& t)
{
beginInsertRows(QModelIndex(), m_instances.size(), m_instances.size() + t.size() - 1);
beginInsertRows(QModelIndex(), count(), static_cast<int>(count() + t.size() - 1));
for (auto& ptr : t) {
m_instances.push_back(std::move(ptr));
connect(m_instances.back().get(), &BaseInstance::propertiesChanged, this, &InstanceList::propertiesChanged);
@ -644,7 +644,7 @@ QModelIndex InstanceList::getInstanceIndexById(const QString& id) const
int InstanceList::getInstIndex(BaseInstance* inst) const
{
int count = m_instances.size();
int count = this->count();
for (int i = 0; i < count; i++) {
if (inst == m_instances.at(i).get()) {
return i;