mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 17:21:27 -05:00
fixed closing of comments tab when comments update
This commit is contained in:
parent
f064325592
commit
2af66e91c5
@ -432,9 +432,20 @@ void PostedListWidgetWithModel::handleEvent_main_thread(std::shared_ptr<const Rs
|
|||||||
|
|
||||||
switch(e->mPostedEventCode)
|
switch(e->mPostedEventCode)
|
||||||
{
|
{
|
||||||
|
case RsPostedEventCode::NEW_MESSAGE: // [[fallthrough]];
|
||||||
|
{
|
||||||
|
// special treatment here because the message might be a comment, so we need to refresh the comment tab if openned
|
||||||
|
|
||||||
|
for(int i=2;i<ui->tabWidget->count();++i)
|
||||||
|
{
|
||||||
|
auto *t = dynamic_cast<GxsCommentDialog*>(ui->tabWidget->widget(i));
|
||||||
|
|
||||||
|
if(t->groupId() == e->mPostedGroupId)
|
||||||
|
t->refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
case RsPostedEventCode::NEW_POSTED_GROUP: // [[fallthrough]];
|
case RsPostedEventCode::NEW_POSTED_GROUP: // [[fallthrough]];
|
||||||
case RsPostedEventCode::UPDATED_POSTED_GROUP: // [[fallthrough]];
|
case RsPostedEventCode::UPDATED_POSTED_GROUP: // [[fallthrough]];
|
||||||
case RsPostedEventCode::NEW_MESSAGE: // [[fallthrough]];
|
|
||||||
case RsPostedEventCode::UPDATED_MESSAGE:
|
case RsPostedEventCode::UPDATED_MESSAGE:
|
||||||
{
|
{
|
||||||
if(e->mPostedGroupId == groupId())
|
if(e->mPostedGroupId == groupId())
|
||||||
@ -550,11 +561,14 @@ void PostedListWidgetWithModel::updateGroupData()
|
|||||||
|
|
||||||
RsQThreadUtils::postToObject( [this,groups]()
|
RsQThreadUtils::postToObject( [this,groups]()
|
||||||
{
|
{
|
||||||
|
bool group_changed = (groups[0].mMeta.mGroupId!=mGroup.mMeta.mGroupId);
|
||||||
|
|
||||||
mGroup = groups[0];
|
mGroup = groups[0];
|
||||||
mPostedPostsModel->updateBoard(groupId());
|
mPostedPostsModel->updateBoard(groupId());
|
||||||
|
|
||||||
insertBoardDetails(mGroup);
|
insertBoardDetails(mGroup);
|
||||||
|
|
||||||
|
if(group_changed)
|
||||||
while(ui->tabWidget->widget(2) != nullptr)
|
while(ui->tabWidget->widget(2) != nullptr)
|
||||||
tabCloseRequested(2);
|
tabCloseRequested(2);
|
||||||
|
|
||||||
|
@ -43,8 +43,10 @@ public:
|
|||||||
RsGxsGroupId groupId() { return mGrpId; }
|
RsGxsGroupId groupId() { return mGrpId; }
|
||||||
RsGxsMessageId messageId() { return mMostRecentMsgId; }
|
RsGxsMessageId messageId() { return mMostRecentMsgId; }
|
||||||
|
|
||||||
private slots:
|
public slots:
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
|
private slots:
|
||||||
void idChooserReady();
|
void idChooserReady();
|
||||||
void voterSelectionChanged( int index );
|
void voterSelectionChanged( int index );
|
||||||
void sortComments(int);
|
void sortComments(int);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user