fix: get rid of some more warnings (#5672)

This commit is contained in:
nerix
2024-10-27 13:42:23 +01:00
committed by GitHub
parent 74a385dfee
commit bbcd8c5eb2
21 changed files with 79 additions and 64 deletions
@@ -37,7 +37,7 @@ void UnifiedSource::addToListModel(GenericListModel &model,
source->addToListModel(model, maxCount - used);
// Calculate how many items have been added so far
used = model.rowCount() - startingSize;
if (used >= maxCount)
if (used >= static_cast<int>(maxCount))
{
// Used up all of limit
break;
@@ -58,15 +58,15 @@ void UnifiedSource::addToStringList(QStringList &list, size_t maxCount,
}
// Make sure to only add maxCount elements in total.
int startingSize = list.size();
int used = 0;
auto startingSize = list.size();
QStringList::size_type used = 0;
for (const auto &source : this->sources_)
{
source->addToStringList(list, maxCount - used, isFirstWord);
// Calculate how many items have been added so far
used = list.size() - startingSize;
if (used >= maxCount)
if (used >= static_cast<QStringList::size_type>(maxCount))
{
// Used up all of limit
break;