mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 11:54:30 -04:00
removed calls to getServiceStatistics from GxsUserNotify and replaced by info collected by GxsGroupFrameDialog
This commit is contained in:
parent
c60f1d1331
commit
b0e61376f1
14 changed files with 47 additions and 62 deletions
|
@ -1116,7 +1116,7 @@ void GxsGroupFrameDialog::updateGroupStatistics(const RsGxsGroupId &groupId)
|
|||
return;
|
||||
}
|
||||
|
||||
RsQThreadUtils::postToObject( [this,stats]()
|
||||
RsQThreadUtils::postToObject( [this,stats, groupId]()
|
||||
{
|
||||
/* Here it goes any code you want to be executed on the Qt Gui
|
||||
* thread, for example to update the data model with new information
|
||||
|
@ -1129,6 +1129,7 @@ void GxsGroupFrameDialog::updateGroupStatistics(const RsGxsGroupId &groupId)
|
|||
return;
|
||||
|
||||
ui->groupTreeWidget->setUnreadCount(item, mCountChildMsgs ? (stats.mNumThreadMsgsUnread + stats.mNumChildMsgsUnread) : stats.mNumThreadMsgsUnread);
|
||||
mCachedGroupStats[groupId] = stats;
|
||||
|
||||
getUserNotify()->updateIcon();
|
||||
|
||||
|
@ -1136,6 +1137,23 @@ void GxsGroupFrameDialog::updateGroupStatistics(const RsGxsGroupId &groupId)
|
|||
});
|
||||
}
|
||||
|
||||
void GxsGroupFrameDialog::getServiceStatistics(GxsServiceStatistic& stats) const
|
||||
{
|
||||
stats = GxsServiceStatistic(); // clears everything
|
||||
|
||||
for(auto it: mCachedGroupStats)
|
||||
{
|
||||
const GxsGroupStatistic& s(it.second);
|
||||
|
||||
stats.mNumMsgs += s.mNumMsgs;
|
||||
stats.mNumGrps += 1;
|
||||
stats.mSizeOfMsgs += s.mTotalSizeOfMsgs;
|
||||
stats.mNumThreadMsgsNew += s.mNumThreadMsgsNew;
|
||||
stats.mNumThreadMsgsUnread += s.mNumThreadMsgsUnread;
|
||||
stats.mNumChildMsgsNew += s.mNumChildMsgsNew ;
|
||||
stats.mNumChildMsgsUnread += s.mNumChildMsgsUnread ;
|
||||
}
|
||||
}
|
||||
|
||||
TurtleRequestId GxsGroupFrameDialog::distantSearch(const QString& search_string) // this should be overloaded in the child class
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue