mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 19:26:31 -04:00
fixed up the update of message count using a flag to only update when necessary, which limits drastically the calls to getGroupsStatistics()
This commit is contained in:
parent
65af73f8eb
commit
5c71a46c52
4 changed files with 42 additions and 16 deletions
|
@ -182,7 +182,26 @@ void GxsGroupFrameDialog::showEvent(QShowEvent *event)
|
|||
initUi();
|
||||
}
|
||||
|
||||
updateDisplay( mCachedGroupMetas.empty() );
|
||||
bool empty = mCachedGroupMetas.empty();
|
||||
|
||||
updateDisplay( empty );
|
||||
}
|
||||
|
||||
void GxsGroupFrameDialog::paintEvent(QPaintEvent *pe)
|
||||
{
|
||||
if(mShouldUpdateMessageSummaryList)
|
||||
{
|
||||
if(!mGroupIdsSummaryToUpdate.empty())
|
||||
for(auto& group_id: mGroupIdsSummaryToUpdate)
|
||||
updateMessageSummaryListReal(group_id);
|
||||
else
|
||||
updateMessageSummaryListReal(RsGxsGroupId());
|
||||
|
||||
mShouldUpdateMessageSummaryList = false;
|
||||
mGroupIdsSummaryToUpdate.clear();
|
||||
}
|
||||
|
||||
MainPage::paintEvent(pe);
|
||||
}
|
||||
|
||||
void GxsGroupFrameDialog::processSettings(bool load)
|
||||
|
@ -988,6 +1007,18 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list<RsGxsGenericGroupData
|
|||
}
|
||||
|
||||
void GxsGroupFrameDialog::updateMessageSummaryList(RsGxsGroupId groupId)
|
||||
{
|
||||
// groupId.isNull() means that we need to update all groups so we clear up the list of groups to update.
|
||||
|
||||
if(!groupId.isNull())
|
||||
mGroupIdsSummaryToUpdate.insert(groupId);
|
||||
else
|
||||
mGroupIdsSummaryToUpdate.clear();
|
||||
|
||||
mShouldUpdateMessageSummaryList = true;
|
||||
}
|
||||
|
||||
void GxsGroupFrameDialog::updateMessageSummaryListReal(RsGxsGroupId groupId)
|
||||
{
|
||||
if (!mInitialized) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue