mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fix GxsForumModel::setMsgReadStatus dataChanged call
This commit is contained in:
parent
ad1672a0a4
commit
319ebd66f6
@ -1225,7 +1225,7 @@ void RsGxsForumModel::setMsgReadStatus(const QModelIndex& i,bool read_status,boo
|
||||
if(!i.isValid())
|
||||
return ;
|
||||
|
||||
// no need to call preMods()/postMods() here because we'renot changing the model
|
||||
// no need to call preMods()/postMods() here because we'renot changing the model
|
||||
|
||||
void *ref = i.internalPointer();
|
||||
uint32_t entry = 0;
|
||||
@ -1233,18 +1233,10 @@ void RsGxsForumModel::setMsgReadStatus(const QModelIndex& i,bool read_status,boo
|
||||
if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size())
|
||||
return ;
|
||||
|
||||
bool has_unread_below,has_read_below;
|
||||
recursSetMsgReadStatus(entry,read_status,with_children) ;
|
||||
bool has_unread_below, has_read_below;
|
||||
recursSetMsgReadStatus(entry,read_status,with_children) ;
|
||||
recursUpdateReadStatusAndTimes(0,has_unread_below,has_read_below);
|
||||
|
||||
// Normally we should only update the parents up to the top of the tree, but it's complicated and the update here doesn't really cost,
|
||||
// so we blindly update the whole widget.
|
||||
|
||||
if(mTreeMode == TREE_MODE_FLAT)
|
||||
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mPosts.size(),COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL));
|
||||
else
|
||||
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mPosts[0].mChildren.size(),COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL));
|
||||
|
||||
}
|
||||
|
||||
void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status,bool with_children)
|
||||
@ -1270,6 +1262,9 @@ void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status,
|
||||
}
|
||||
else
|
||||
rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, mPosts[i].mMsgId ), read_status);
|
||||
|
||||
QModelIndex itemIndex = createIndex(i - 1, 0, &mPosts[i]);
|
||||
emit dataChanged(itemIndex, itemIndex);
|
||||
}
|
||||
|
||||
if(!with_children)
|
||||
|
Loading…
Reference in New Issue
Block a user