Skip to content

Commit

Permalink
Remove some uses of continue keywords.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Jan 22, 2025
1 parent dfcc904 commit bc6db33
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
14 changes: 7 additions & 7 deletions src/GUI/TabWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ QVector<std::pair<QString, int>> TabWidget::getStringColumnsWithIndexes(
const int count{model->columnCount(QModelIndex())};
for (int column{0}; column < count; ++column)
{
if (model->getColumnFormat(column) != ColumnType::STRING)
continue;

const QString columnName{
model->headerData(column, Qt::Horizontal, Qt::DisplayRole)
.toString()};
stringColumns.append({columnName, column});
if (model->getColumnFormat(column) == ColumnType::STRING)
{
const QString columnName{
model->headerData(column, Qt::Horizontal, Qt::DisplayRole)
.toString()};
stringColumns.append({columnName, column});
}
}
return stringColumns;
}
Expand Down
35 changes: 18 additions & 17 deletions src/ModelsAndViews/DataView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,24 @@ QVector<TransactionData> DataView::fillDataFromSelection(
if ((i % batchSize) == 0)
QApplication::processEvents();

if (!selectionModelOfView->isSelected(proxyModel->index(i, 0)))
continue;
const QVariant& dateVariant{
proxyModel->index(i, transactionDateColumn).data()};
if (dateVariant.isNull())
continue;

TransactionData transactionData;
transactionData.date_ = dateVariant.toDate();
transactionData.pricePerMeter_ =
proxyModel->index(i, pricePerMeterColumn).data().toDouble();

if (groupByColumn != constants::NOT_SET_COLUMN)
transactionData.groupedBy_ =
proxyModel->index(i, groupByColumn).data();

calcDataContainer.append(transactionData);
if (selectionModelOfView->isSelected(proxyModel->index(i, 0)))
{
const QVariant& dateVariant{
proxyModel->index(i, transactionDateColumn).data()};
if (!dateVariant.isNull())
{
TransactionData transactionData;
transactionData.date_ = dateVariant.toDate();
transactionData.pricePerMeter_ =
proxyModel->index(i, pricePerMeterColumn).data().toDouble();

if (groupByColumn != constants::NOT_SET_COLUMN)
transactionData.groupedBy_ =
proxyModel->index(i, groupByColumn).data();

calcDataContainer.append(transactionData);
}
}
}

return calcDataContainer;
Expand Down

0 comments on commit bc6db33

Please sign in to comment.