From 244e8a810a6b8f1b1da363ee5a52ea67c60ecc0b Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 1 Jul 2017 15:29:48 +0200 Subject: [PATCH] fixed display of GxsTrans statistics --- .../src/gui/statistics/GxsTransportStatistics.cpp | 7 ++++--- retroshare-gui/src/gui/statistics/GxsTransportStatistics.h | 3 ++- .../src/gui/statistics/GxsTransportStatistics.ui | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp index 972dbd415..36aa7aa96 100644 --- a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp @@ -266,12 +266,12 @@ void GxsTransportStatistics::updateContent() QString msg_time_string = (stat.last_publish_TS>0)?QString(" (Last msg: %1)").arg(QDateTime::fromTime_t(stat.last_publish_TS).toString()):"" ; - item->setData(COL_GROUP_UNIQUE_ID, Qt::DisplayRole, QString::fromStdString(stat.mGrpId.toStdString())) ; item->setData(COL_GROUP_NUM_MSGS, Qt::DisplayRole, QString::number(stat.mNumMsgs) + msg_time_string) ; - item->setData(COL_GROUP_GRP_ID, Qt::DisplayRole, QString::fromStdString(stat.mGrpId.toStdString())) ; + item->setData(COL_GROUP_GRP_ID, Qt::DisplayRole, QString::fromStdString(it->first.toStdString())) ; item->setData(COL_GROUP_SIZE_MSGS, Qt::DisplayRole, QString::number(stat.mTotalSizeOfMsgs)) ; item->setData(COL_GROUP_SUBSCRIBED,Qt::DisplayRole, stat.subscribed?tr("Yes"):tr("No")) ; item->setData(COL_GROUP_POPULARITY,Qt::DisplayRole, QString::number(stat.popularity)) ; + item->setData(COL_GROUP_UNIQUE_ID, Qt::DisplayRole, QString::fromStdString(it->first.toStdString())) ; for(std::map::const_iterator msgIt(stat.messages_metas.begin());msgIt!=stat.messages_metas.end();++msgIt) { @@ -436,6 +436,7 @@ void GxsTransportStatistics::loadGroupMeta(const uint32_t& token) RsGxsTransGroupStatistics& s(mGroupStats[vit->mGroupId]); s.popularity = vit->mPop ; s.subscribed = IS_GROUP_SUBSCRIBED(vit->mSubscribeFlags) ; + s.mGrpId = vit->mGroupId ; } // remove group stats for group that do not exist anymore @@ -458,6 +459,6 @@ void GxsTransportStatistics::loadMsgMeta(const uint32_t& token) for(GxsMsgMetaMap::const_iterator it(m.begin());it!=m.end();++it) for(uint32_t i=0;isecond.size();++i) - mGroupStats[it->first].addMessageMeta(it->second[i]) ; + mGroupStats[it->first].addMessageMeta(it->first,it->second[i]) ; } diff --git a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.h b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.h index 75a93a7a6..f024edd0f 100644 --- a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.h +++ b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.h @@ -45,10 +45,11 @@ public: subscribed = false; } - void addMessageMeta(const RsMsgMetaData& meta) + void addMessageMeta(const RsGxsGroupId& grp,const RsMsgMetaData& meta) { messages_metas[meta.mMsgId] = meta ; last_publish_TS = std::max(last_publish_TS,meta.mPublishTs) ; + mGrpId = grp ; } bool subscribed ; diff --git a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.ui b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.ui index 78653b5ae..4d4f61d62 100644 --- a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.ui +++ b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.ui @@ -101,7 +101,7 @@ - Total size of messages + Local size of data