mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-25 06:40:58 -04:00
gxsforums: restore post's selection after clearing search filter
This commit is contained in:
parent
b265cdf284
commit
2c03deaa33
1 changed files with 18 additions and 2 deletions
|
@ -1803,8 +1803,24 @@ void GxsForumThreadWidget::filterItems(const QString& text)
|
|||
|
||||
if(!lst.empty())
|
||||
ui->threadTreeWidget->expandAll();
|
||||
else
|
||||
else {
|
||||
// currentIndex() not on the clicked message, so not this way
|
||||
// if (!mThreadId.isNull()) {
|
||||
// an_index = mThreadProxyModel->mapToSource(ui->threadTreeWidget->currentIndex());
|
||||
// }
|
||||
ui->threadTreeWidget->collapseAll();
|
||||
if (!mThreadId.isNull()) {
|
||||
// ...but this one
|
||||
QModelIndex an_index = mThreadModel->getIndexOfMessage(mThreadId);
|
||||
if (an_index.isValid()) {
|
||||
QModelIndex the_index = mThreadProxyModel->mapFromSource(an_index);
|
||||
ui->threadTreeWidget->setCurrentIndex(the_index);
|
||||
ui->threadTreeWidget->scrollTo(the_index);
|
||||
// don't change focus
|
||||
// ui->threadTreeWidget->setFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(count > 0)
|
||||
ui->filterLineEdit->setToolTip(tr("No result.")) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue