Skip to content

Commit

Permalink
Select first index in attach process list
Browse files Browse the repository at this point in the history
This selects the first index by default when there's no old PID.
  • Loading branch information
redstrate committed Jan 12, 2024
1 parent 6feea95 commit 630cafb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion launcher/ui/attachdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,12 @@ void AttachDialog::updateProcessesFinished()
}
const int oldPid = pid();
m_model->mergeProcesses(watcher->result());
if (oldPid != pid())
if (oldPid == 0) {
ui->view->setCurrentIndex(m_proxyModel->index(0, 0));
} else if (oldPid != pid()) {
ui->view->setCurrentIndex(QModelIndex());
}

watcher->deleteLater();

QTimer::singleShot(1000, this, &AttachDialog::updateProcesses);
Expand Down

0 comments on commit 630cafb

Please sign in to comment.