Skip to content

Commit

Permalink
const ref
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed May 4, 2024
1 parent 17314b4 commit 455d692
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gui/resultstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ void ResultsTree::copy()
return;

QString text;
for (QModelIndex index : mSelectionModel->selectedRows()) {
for (const QModelIndex& index : mSelectionModel->selectedRows()) {
QStandardItem *item = mModel.itemFromIndex(index);
if (!item->parent()) {
text += item->text() + '\n';
Expand Down Expand Up @@ -929,7 +929,7 @@ void ResultsTree::hideResult()
if (!mSelectionModel)
return;

for (QModelIndex index : mSelectionModel->selectedRows()) {
for (const QModelIndex& index : mSelectionModel->selectedRows()) {
QStandardItem *item = mModel.itemFromIndex(index);
//Set the "hide" flag for this item
QVariantMap data = item->data().toMap();
Expand All @@ -947,7 +947,7 @@ void ResultsTree::recheckSelectedFiles()
return;

QStringList selectedItems;
for (QModelIndex index : mSelectionModel->selectedRows()) {
for (const QModelIndex& index : mSelectionModel->selectedRows()) {
QStandardItem *item = mModel.itemFromIndex(index);
while (item->parent())
item = item->parent();
Expand Down Expand Up @@ -1029,7 +1029,7 @@ void ResultsTree::suppressSelectedIds()
return;

QSet<QString> selectedIds;
for (QModelIndex index : mSelectionModel->selectedRows()) {
for (const QModelIndex& index : mSelectionModel->selectedRows()) {
QStandardItem *item = mModel.itemFromIndex(index);
if (!item->parent())
continue;
Expand Down Expand Up @@ -1068,7 +1068,7 @@ void ResultsTree::suppressHash()

// Extract selected warnings
QSet<QStandardItem *> selectedWarnings;
for (QModelIndex index : mSelectionModel->selectedRows()) {
for (const QModelIndex& index : mSelectionModel->selectedRows()) {
QStandardItem *item = mModel.itemFromIndex(index);
if (!item->parent())
continue;
Expand Down Expand Up @@ -1115,7 +1115,7 @@ void ResultsTree::tagSelectedItems(const QString &tag)
return;
bool isTagged = false;
ProjectFile *currentProject = ProjectFile::getActiveProject();
for (QModelIndex index : mSelectionModel->selectedRows()) {
for (const QModelIndex& index : mSelectionModel->selectedRows()) {
QStandardItem *item = mModel.itemFromIndex(index);
QVariantMap data = item->data().toMap();
if (data.contains("tags")) {
Expand Down

0 comments on commit 455d692

Please sign in to comment.