mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-09-19 20:34:49 -04:00
gui: newfriendlist: select row above when deleting profile
This commit is contained in:
parent
000d019947
commit
04636a8b6e
1 changed files with 9 additions and 0 deletions
|
@ -1015,6 +1015,15 @@ void NewFriendList::removeProfile()
|
|||
if ((QMessageBox::question(this, "RetroShare", tr("Do you want to remove this Friend?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes)) == QMessageBox::Yes)
|
||||
rsPeers->removeFriend(det.gpg_id);
|
||||
|
||||
QModelIndex index_to_remove = ui->peerTreeWidget->selectionModel()->selectedIndexes().first();
|
||||
// could be only one selected item
|
||||
ui->peerTreeWidget->selectionModel()->select(index_to_remove, QItemSelectionModel::Clear);
|
||||
// otherwise already at top
|
||||
QModelIndex index_to_select = ui->peerTreeWidget->indexAbove(index_to_remove);
|
||||
if (index_to_select.isValid()) {
|
||||
ui->peerTreeWidget->selectionModel()->select(index_to_select, QItemSelectionModel::Select | QItemSelectionModel::Rows);
|
||||
}
|
||||
|
||||
checkInternalData(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue