mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
re-enabled GroupMetaCache in GxsGroupFrameDialog and only reload fully when needed
This commit is contained in:
parent
83b130fa90
commit
7ba83272cf
@ -137,6 +137,8 @@ void GxsGroupFrameDialog::getGroupList(std::map<RsGxsGroupId, RsGroupMetaData> &
|
|||||||
|
|
||||||
if(group_list.empty())
|
if(group_list.empty())
|
||||||
updateGroupSummary();
|
updateGroupSummary();
|
||||||
|
else
|
||||||
|
std::cerr << "************** Using cached GroupMetaData" << std::endl;
|
||||||
}
|
}
|
||||||
void GxsGroupFrameDialog::initUi()
|
void GxsGroupFrameDialog::initUi()
|
||||||
{
|
{
|
||||||
@ -181,9 +183,7 @@ void GxsGroupFrameDialog::showEvent(QShowEvent *event)
|
|||||||
initUi();
|
initUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDisplay(true);
|
updateDisplay( mCachedGroupMetas.empty() );
|
||||||
|
|
||||||
// RsGxsUpdateBroadcastPage::showEvent(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsGroupFrameDialog::processSettings(bool load)
|
void GxsGroupFrameDialog::processSettings(bool load)
|
||||||
@ -1051,10 +1051,17 @@ void GxsGroupFrameDialog::updateGroupSummary()
|
|||||||
mNavigatePendingGroupId.clear();
|
mNavigatePendingGroupId.clear();
|
||||||
mNavigatePendingMsgId.clear();
|
mNavigatePendingMsgId.clear();
|
||||||
}
|
}
|
||||||
|
// update the local cache in order to avoid re-asking the data when the UI wants it (this happens on ::show() for instance)
|
||||||
|
|
||||||
|
mCachedGroupMetas.clear();
|
||||||
|
|
||||||
// now delete the data that is not used anymore
|
// now delete the data that is not used anymore
|
||||||
|
|
||||||
for(auto& g:groupInfo)
|
for(auto& g:groupInfo)
|
||||||
|
{
|
||||||
|
mCachedGroupMetas[g->mMeta.mGroupId] = g->mMeta;
|
||||||
delete g;
|
delete g;
|
||||||
|
}
|
||||||
|
|
||||||
}, this );
|
}, this );
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user