Fix warning about signed/unsigned comparison

Use int instead of unsigned and do some code cosmetics while at it.
This commit is contained in:
Tobias Hunger
2011-04-08 11:14:11 +02:00
parent 9043b8e73a
commit 6db7426d5e
2 changed files with 6 additions and 6 deletions

View File

@@ -518,7 +518,7 @@ void SubmitEditorWidget::updateDiffAction()
void SubmitEditorWidget::updateCheckAllComboBox()
{
m_d->m_ignoreChange = true;
unsigned checkedCount = checkedFilesCount();
int checkedCount = checkedFilesCount();
if (checkedCount == 0)
m_d->m_ui.checkAllCheckBox->setCheckState(Qt::Unchecked);
else if (checkedCount == m_d->m_ui.fileView->model()->rowCount())
@@ -536,14 +536,14 @@ bool SubmitEditorWidget::hasSelection() const
return false;
}
unsigned SubmitEditorWidget::checkedFilesCount() const
int SubmitEditorWidget::checkedFilesCount() const
{
unsigned checkedCount = 0;
int checkedCount = 0;
if (const QAbstractItemModel *model = m_d->m_ui.fileView->model()) {
const int count = model->rowCount();
for (int i = 0; i < count; i++)
for (int i = 0; i < count; ++i)
if (listModelChecked(model, i, checkableColumn))
checkedCount++;
++checkedCount;
}
return checkedCount;
}

View File

@@ -145,7 +145,7 @@ private slots:
private:
bool hasSelection() const;
unsigned checkedFilesCount() const;
int checkedFilesCount() const;
SubmitEditorWidgetPrivate *m_d;
};