added code to change posts read status

This commit is contained in:
csoler 2020-09-22 23:32:10 +02:00
parent 010fc1dc44
commit 5dfa481f2f
9 changed files with 46 additions and 9 deletions

View file

@ -181,6 +181,7 @@ QWidget *PostedPostDelegate::createEditor(QWidget *parent, const QStyleOptionVie
QObject::connect(w,SIGNAL(vote(RsGxsGrpMsgIdPair,bool)),mPostListWidget,SLOT(voteMsg(RsGxsGrpMsgIdPair,bool)));
QObject::connect(w,SIGNAL(expand(RsGxsMessageId,bool)),this,SLOT(expandItem(RsGxsMessageId,bool)));
QObject::connect(w,SIGNAL(commentsRequested(const RsGxsMessageId&,bool)),mPostListWidget,SLOT(openComments(const RsGxsMessageId&)));
QObject::connect(w,SIGNAL(changeReadStatusRequested(const RsGxsMessageId&,bool)),mPostListWidget,SLOT(changeReadStatus(const RsGxsMessageId&,bool)));
w->setFixedSize(option.rect.size());
w->adjustSize();
@ -666,6 +667,11 @@ void PostedListWidgetWithModel::openComments(const RsGxsMessageId& msgId)
ui->tabWidget->addTab(commentDialog,title);
}
void PostedListWidgetWithModel::changeReadStatus(const RsGxsMessageId& msgId,bool b)
{
QModelIndex index=mPostedPostsModel->getIndexOfMessage(msgId);
mPostedPostsModel->setMsgReadStatus(index, b);
}
void PostedListWidgetWithModel::tabCloseRequested(int index)
{
std::cerr << "GxsCommentContainer::tabCloseRequested(" << index << ")";