Merge pull request #9060 from Chocobo1/preinc

Replace post-increment with pre-increment
This commit is contained in:
Mike Tzou
2018-06-09 12:40:30 +08:00
committed by GitHub
16 changed files with 58 additions and 58 deletions

View File

@@ -102,7 +102,7 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent)
hideColumn(PeerListDelegate::COUNTRY);
// Ensure that at least one column is visible at all times
bool atLeastOne = false;
for (unsigned int i = 0; i < PeerListDelegate::IP_HIDDEN; i++) {
for (unsigned int i = 0; i < PeerListDelegate::IP_HIDDEN; ++i) {
if (!isColumnHidden(i)) {
atLeastOne = true;
break;
@@ -113,7 +113,7 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent)
// To also mitigate the above issue, we have to resize each column when
// its size is 0, because explicitly 'showing' the column isn't enough
// in the above scenario.
for (unsigned int i = 0; i < PeerListDelegate::IP_HIDDEN; i++)
for (unsigned int i = 0; i < PeerListDelegate::IP_HIDDEN; ++i)
if ((columnWidth(i) <= 0) && !isColumnHidden(i))
resizeColumnToContents(i);
// Context menu
@@ -168,9 +168,9 @@ void PeerListWidget::displayToggleColumnsMenu(const QPoint &)
actions.append(myAct);
}
int visibleCols = 0;
for (unsigned int i = 0; i < PeerListDelegate::IP_HIDDEN; i++) {
for (unsigned int i = 0; i < PeerListDelegate::IP_HIDDEN; ++i) {
if (!isColumnHidden(i))
visibleCols++;
++visibleCols;
if (visibleCols > 1)
break;

View File

@@ -424,7 +424,7 @@ void PluginSelectDlg::checkForUpdatesFinished(const QHash<QString, PluginVersion
for (auto i = updateInfo.cbegin(); i != updateInfo.cend(); ++i) {
startAsyncOp();
m_pendingUpdates++;
++m_pendingUpdates;
m_pluginManager->updatePlugin(i.key());
}
}

View File

@@ -104,7 +104,7 @@ SearchTab::SearchTab(SearchHandler *searchHandler, QWidget *parent)
// Ensure that at least one column is visible at all times
bool atLeastOne = false;
for (unsigned int i = 0; i < SearchSortModel::DL_LINK; i++) {
for (unsigned int i = 0; i < SearchSortModel::DL_LINK; ++i) {
if (!m_ui->resultsBrowser->isColumnHidden(i)) {
atLeastOne = true;
break;
@@ -115,7 +115,7 @@ SearchTab::SearchTab(SearchHandler *searchHandler, QWidget *parent)
// To also mitigate the above issue, we have to resize each column when
// its size is 0, because explicitly 'showing' the column isn't enough
// in the above scenario.
for (unsigned int i = 0; i < SearchSortModel::DL_LINK; i++)
for (unsigned int i = 0; i < SearchSortModel::DL_LINK; ++i)
if ((m_ui->resultsBrowser->columnWidth(i) <= 0) && !m_ui->resultsBrowser->isColumnHidden(i))
m_ui->resultsBrowser->resizeColumnToContents(i);
@@ -375,9 +375,9 @@ void SearchTab::displayToggleColumnsMenu(const QPoint&)
actions.append(myAct);
}
int visibleCols = 0;
for (unsigned int i = 0; i < SearchSortModel::DL_LINK; i++) {
for (unsigned int i = 0; i < SearchSortModel::DL_LINK; ++i) {
if (!m_ui->resultsBrowser->isColumnHidden(i))
visibleCols++;
++visibleCols;
if (visibleCols > 1)
break;

View File

@@ -131,7 +131,7 @@ bool TorrentContentFilterModel::hasFiltered(const QModelIndex &folder) const
QString name = folder.data().toString();
if (name.contains(filterRegExp()))
return true;
for (int child = 0; child < m_model->rowCount(folder); child++) {
for (int child = 0; child < m_model->rowCount(folder); ++child) {
QModelIndex childIndex = m_model->index(child, 0, folder);
if (m_model->hasChildren(childIndex)) {
if (hasFiltered(childIndex))

View File

@@ -260,7 +260,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *mainWindow)
//Ensure that at least one column is visible at all times
bool atLeastOne = false;
for (unsigned int i = 0; i<TorrentModel::NB_COLUMNS; i++) {
for (unsigned int i = 0; i < TorrentModel::NB_COLUMNS; ++i) {
if (!isColumnHidden(i)) {
atLeastOne = true;
break;
@@ -272,7 +272,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *mainWindow)
//When adding/removing columns between versions some may
//end up being size 0 when the new version is launched with
//a conf file from the previous version.
for (unsigned int i = 0; i<TorrentModel::NB_COLUMNS; i++)
for (unsigned int i = 0; i < TorrentModel::NB_COLUMNS; ++i)
if ((columnWidth(i) <= 0) && (!isColumnHidden(i)))
resizeColumnToContents(i);
@@ -713,9 +713,9 @@ void TransferListWidget::displayDLHoSMenu(const QPoint&)
actions.append(myAct);
}
int visibleCols = 0;
for (unsigned int i = 0; i<TorrentModel::NB_COLUMNS; i++) {
for (unsigned int i = 0; i < TorrentModel::NB_COLUMNS; ++i) {
if (!isColumnHidden(i))
visibleCols++;
++visibleCols;
if (visibleCols > 1)
break;