From b294b4b503f3f199df83f60c46c09f4433b8351c Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 29 Jun 2017 22:11:44 +0200 Subject: [PATCH] changed sorting of popular forums w.r.t. time of last post rather than number of supplier friends --- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 8ae997eab..816db2377 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -815,8 +815,8 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list &gro } else { - /* rate the others by popularity */ - popMap.insert(std::make_pair(it->mPop, groupItemInfo)); + //popMap.insert(std::make_pair(it->mPop, groupItemInfo)); /* rate the others by popularity */ + popMap.insert(std::make_pair(it->mLastPost, groupItemInfo)); /* rate the others by time of last post */ } } @@ -830,17 +830,17 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list &gro uint32_t i = 0; uint32_t popLimit = 0; std::multimap::reverse_iterator rit; - for(rit = popMap.rbegin(); ((rit != popMap.rend()) && (i < popCount)); ++rit, ++i) ; - if (rit != popMap.rend()) { - popLimit = rit->first; - } + //for(rit = popMap.rbegin(); ((rit != popMap.rend()) && (i < popCount)); ++rit, ++i) ; + //if (rit != popMap.rend()) { + // popLimit = rit->first; + //} - for (rit = popMap.rbegin(); rit != popMap.rend(); ++rit) { - if (rit->second.popularity < (int) popLimit) { - otherList.append(rit->second); - } else { + for (rit = popMap.rbegin(); rit != popMap.rend(); ++rit,++i) { + //if (rit->second.popularity > (int) popLimit) { + if(i < popCount) popList.append(rit->second); - } + else + otherList.append(rit->second); } /* now we can add them in as a tree! */