forked from qt-creator/qt-creator
Fix warning about signed/unsigned comparison
Use int instead of unsigned and do some code cosmetics while at it.
This commit is contained in:
@@ -518,7 +518,7 @@ void SubmitEditorWidget::updateDiffAction()
|
|||||||
void SubmitEditorWidget::updateCheckAllComboBox()
|
void SubmitEditorWidget::updateCheckAllComboBox()
|
||||||
{
|
{
|
||||||
m_d->m_ignoreChange = true;
|
m_d->m_ignoreChange = true;
|
||||||
unsigned checkedCount = checkedFilesCount();
|
int checkedCount = checkedFilesCount();
|
||||||
if (checkedCount == 0)
|
if (checkedCount == 0)
|
||||||
m_d->m_ui.checkAllCheckBox->setCheckState(Qt::Unchecked);
|
m_d->m_ui.checkAllCheckBox->setCheckState(Qt::Unchecked);
|
||||||
else if (checkedCount == m_d->m_ui.fileView->model()->rowCount())
|
else if (checkedCount == m_d->m_ui.fileView->model()->rowCount())
|
||||||
@@ -536,14 +536,14 @@ bool SubmitEditorWidget::hasSelection() const
|
|||||||
return false;
|
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()) {
|
if (const QAbstractItemModel *model = m_d->m_ui.fileView->model()) {
|
||||||
const int count = model->rowCount();
|
const int count = model->rowCount();
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; ++i)
|
||||||
if (listModelChecked(model, i, checkableColumn))
|
if (listModelChecked(model, i, checkableColumn))
|
||||||
checkedCount++;
|
++checkedCount;
|
||||||
}
|
}
|
||||||
return checkedCount;
|
return checkedCount;
|
||||||
}
|
}
|
||||||
|
@@ -145,7 +145,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool hasSelection() const;
|
bool hasSelection() const;
|
||||||
unsigned checkedFilesCount() const;
|
int checkedFilesCount() const;
|
||||||
|
|
||||||
SubmitEditorWidgetPrivate *m_d;
|
SubmitEditorWidgetPrivate *m_d;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user