refactor: fix clang-tidy auto*, const&, and curly braces (#5083)

This commit is contained in:
pajlada
2024-01-14 17:54:52 +01:00
committed by GitHub
parent 292f9b9734
commit 5b6675abb4
78 changed files with 647 additions and 228 deletions
+7 -1
View File
@@ -53,12 +53,16 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
// Remove rows backwards so indices don't shift.
std::vector<int> rows;
for (auto &&index : selected)
{
rows.push_back(index.row());
}
std::sort(rows.begin(), rows.end(), std::greater{});
for (auto &&row : rows)
{
model_->removeRow(row);
}
});
if (movable)
@@ -135,7 +139,7 @@ void EditableModelView::addCustomButton(QWidget *widget)
void EditableModelView::addRegexHelpLink()
{
auto regexHelpLabel =
auto *regexHelpLabel =
new QLabel("<a href='"
"https://chatterino.com/help/regex'>"
"<span style='color:#99f'>regex info</span></a>");
@@ -152,7 +156,9 @@ void EditableModelView::moveRow(int dir)
(row = selected.at(0).row()) + dir >=
this->model_->rowCount(QModelIndex()) ||
row + dir < 0)
{
return;
}
model_->moveRows(model_->index(row, 0), row, selected.size(),
model_->index(row + dir, 0), row + dir);