update posts when navigating with arrows

This commit is contained in:
csoler 2018-12-03 21:28:00 +01:00
parent 55022432ef
commit 4423600073
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 11 additions and 3 deletions

View File

@ -343,6 +343,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
ui->newthreadButton->setText(tr("New thread"));
connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedThread(QModelIndex)));
connect(ui->threadTreeWidget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)), this, SLOT(changedSelection(const QModelIndex&,const QModelIndex&)));
connect(ui->viewBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changedViewBox()));
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview()));
@ -497,6 +498,11 @@ void GxsForumThreadWidget::processSettings(bool load)
Settings->endGroup();
}
void GxsForumThreadWidget::changedSelection(const QModelIndex& current,const QModelIndex&)
{
changedThread(current);
}
void GxsForumThreadWidget::groupIdChanged()
{
ui->forumName->setText(groupId().isNull () ? "" : tr("Loading..."));
@ -628,12 +634,12 @@ QModelIndex GxsForumThreadWidget::GxsForumThreadWidget::getCurrentIndex() const
}
bool GxsForumThreadWidget::getCurrentPost(ForumModelPostEntry& fmpe) const
{
QModelIndex index = getCurrentIndex() ;
QModelIndex indx = getCurrentIndex() ;
if(!index.isValid())
if(!indx.isValid())
return false ;
return mThreadModel->getPostData(mThreadProxyModel->mapToSource(index),fmpe);
return mThreadModel->getPostData(mThreadProxyModel->mapToSource(indx),fmpe);
}
void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)

View File

@ -32,6 +32,7 @@ class QTreeWidgetItem;
class RSTreeWidgetItemCompareRole;
class RsGxsForumMsg;
class GxsForumsFillThread;
class QItemSelection;
class RsGxsForumGroup;
class RsGxsForumModel;
class RsGxsForumMsg;
@ -97,6 +98,7 @@ private slots:
void threadListCustomPopupMenu(QPoint point);
void contextMenuTextBrowser(QPoint point);
void changedSelection(const QModelIndex &, const QModelIndex &);
void changedThread(QModelIndex index);
void changedVersion();
void clickedThread (QModelIndex index);