mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 03:06:31 -04:00
fixed bug causing link to forum post not to load the post on click if another forum is currently loaed
This commit is contained in:
parent
bf1c433849
commit
0816c44d10
1 changed files with 32 additions and 19 deletions
|
@ -1500,6 +1500,8 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId)
|
||||||
|
|
||||||
if(!source_index.isValid())
|
if(!source_index.isValid())
|
||||||
{
|
{
|
||||||
|
std::cerr << "Cannot navigate to msg " << msgId << " in forum " << mForumGroup.mMeta.mGroupId << ": index unknown. Setting mNavigatePendingMsgId." << std::endl;
|
||||||
|
|
||||||
mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading.
|
mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading.
|
||||||
return true; // we have to return true here, otherwise the caller will intepret the async loading as an error.
|
return true; // we have to return true here, otherwise the caller will intepret the async loading as an error.
|
||||||
}
|
}
|
||||||
|
@ -1855,9 +1857,19 @@ void GxsForumThreadWidget::postForumLoading()
|
||||||
#endif
|
#endif
|
||||||
if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid())
|
if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid())
|
||||||
{
|
{
|
||||||
mThreadId = mNavigatePendingMsgId;
|
std::cerr << "Pending msg navigation: " << mNavigatePendingMsgId << ". Using it as new thread Id" << std::endl;
|
||||||
|
|
||||||
|
QModelIndex source_index = mThreadModel->getIndexOfMessage(mNavigatePendingMsgId);
|
||||||
|
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
||||||
|
|
||||||
|
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||||
|
ui->threadTreeWidget->scrollTo(index);
|
||||||
|
|
||||||
|
changedThread(index);
|
||||||
mNavigatePendingMsgId.clear();
|
mNavigatePendingMsgId.clear();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId);
|
QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId);
|
||||||
|
|
||||||
|
@ -1881,6 +1893,7 @@ void GxsForumThreadWidget::postForumLoading()
|
||||||
//blank();
|
//blank();
|
||||||
}
|
}
|
||||||
// we also need to restore expanded threads
|
// we also need to restore expanded threads
|
||||||
|
}
|
||||||
|
|
||||||
ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
|
ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
|
||||||
ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
|
ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue