Skip to content

Commit

Permalink
Clean up string building
Browse files Browse the repository at this point in the history
  • Loading branch information
dail8859 committed Jul 16, 2024
1 parent 8a887e0 commit b9fde86
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/NotepadNext/docks/SearchResultsDock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ void SearchResultsDock::updateSearchStatus()

void SearchResultsDock::copySearchResultsToClipboard()
{
QClipboard *clipboard = QGuiApplication::clipboard();
QString string;

QStringList results;
QTreeWidgetItemIterator it(ui->treeWidget);

while (*it) {
string.append((*it)->text(0) + ' ' + (*it)->text(1) + '\n');
const QTreeWidgetItem *item = *it;
results.append(QStringLiteral("%1 %2").arg(item->text(0)).arg(item->text(1)));
++it;
}

clipboard->setText(string) ;
QGuiApplication::clipboard()->setText(results.join('\n'));
}

0 comments on commit b9fde86

Please sign in to comment.