Skip to content

Commit

Permalink
fix: keep monitor order when converting to downloads (fix #3136)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Apr 25, 2024
1 parent 234b4a8 commit a164b1e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/src/tabs/monitors-tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ void MonitorsTab::removeSelected()

void MonitorsTab::convertSelected()
{
QSet<int> rows;
// We don't use a QSet because the order of rows is important
QList<int> rows;
for (const QModelIndex &index : ui->tableMonitors->selectionModel()->selection().indexes()) {
rows.insert(m_monitorTableModel->mapToSource(index).row());
const int row = m_monitorTableModel->mapToSource(index).row();
if (!rows.contains(row)) {
rows.append(row);
}
}

for (const int row : rows) {
Expand Down

0 comments on commit a164b1e

Please sign in to comment.