mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-04 04:14:24 -04:00
removed multi-callback based distant search result handling, and use rsEvents instead
This commit is contained in:
parent
8e2c670716
commit
33da5c06b8
15 changed files with 204 additions and 123 deletions
|
@ -286,55 +286,48 @@ void GxsGroupFrameDialog::updateDisplay(bool complete)
|
|||
if(complete) // || !getGrpIds().empty() || !getGrpIdsMeta().empty()) {
|
||||
updateGroupSummary(); /* Update group list */
|
||||
|
||||
updateSearchResults() ;
|
||||
// updateSearchResults() ;
|
||||
}
|
||||
|
||||
void GxsGroupFrameDialog::updateSearchResults()
|
||||
{
|
||||
const std::set<TurtleRequestId>& reqs = getSearchRequests();
|
||||
for(auto& it:mSearchGroupsItems)
|
||||
updateSearchResults(it.first);
|
||||
}
|
||||
|
||||
for(auto it(reqs.begin());it!=reqs.end();++it)
|
||||
{
|
||||
std::cerr << "updating search ID " << std::hex << *it << std::dec << std::endl;
|
||||
void GxsGroupFrameDialog::updateSearchResults(const TurtleRequestId& sid)
|
||||
{
|
||||
std::cerr << "updating search ID " << std::hex << sid << std::dec << std::endl;
|
||||
|
||||
std::map<RsGxsGroupId,RsGxsGroupSummary> group_infos;
|
||||
std::map<RsGxsGroupId,RsGxsGroupSearchResults> group_infos;
|
||||
|
||||
getDistantSearchResults(*it,group_infos) ;
|
||||
getDistantSearchResults(sid,group_infos) ;
|
||||
|
||||
std::cerr << "retrieved " << std::endl;
|
||||
std::cerr << "retrieved " << std::endl;
|
||||
|
||||
auto it2 = mSearchGroupsItems.find(*it);
|
||||
auto it2 = mSearchGroupsItems.find(sid);
|
||||
|
||||
if(mSearchGroupsItems.end() == it2)
|
||||
{
|
||||
std::cerr << "GxsGroupFrameDialog::updateSearchResults(): received result notification for req " << std::hex << *it << std::dec << " but no item present!" << std::endl;
|
||||
continue ; // we could create the item just as well but since this situation is not supposed to happen, I prefer to make this a failure case.
|
||||
}
|
||||
QList<GroupItemInfo> group_items ;
|
||||
|
||||
QList<GroupItemInfo> group_items ;
|
||||
for(auto it3(group_infos.begin());it3!=group_infos.end();++it3)
|
||||
{
|
||||
std::cerr << " adding group " << it3->first << " " << it3->second.mGroupId << " \"" << it3->second.mGroupName << "\"" << std::endl;
|
||||
|
||||
for(auto it3(group_infos.begin());it3!=group_infos.end();++it3)
|
||||
if(mCachedGroupMetas.find(it3->first) == mCachedGroupMetas.end())
|
||||
{
|
||||
std::cerr << " adding new group " << it3->first << " "
|
||||
<< it3->second.mGroupId << " \""
|
||||
<< it3->second.mGroupName << "\"" << std::endl;
|
||||
GroupItemInfo i;
|
||||
i.id = QString(it3->second.mGroupId.toStdString().c_str());
|
||||
i.name = QString::fromUtf8(it3->second.mGroupName.c_str());
|
||||
i.popularity = 0; // could be set to the number of hits
|
||||
i.lastpost = QDateTime::fromTime_t(it3->second.mLastMessageTs);
|
||||
i.subscribeFlags = 0; // irrelevant here
|
||||
i.publishKey = false ; // IS_GROUP_PUBLISHER(groupInfo.mSubscribeFlags);
|
||||
i.adminKey = false ; // IS_GROUP_ADMIN(groupInfo.mSubscribeFlags);
|
||||
i.max_visible_posts = it3->second.mNumberOfMessages;
|
||||
i.context_strings = it3->second.mSearchContexts;
|
||||
|
||||
GroupItemInfo i;
|
||||
i.id = QString(it3->second.mGroupId.toStdString().c_str());
|
||||
i.name = QString::fromUtf8(it3->second.mGroupName.c_str());
|
||||
i.popularity = 0; // could be set to the number of hits
|
||||
i.lastpost = QDateTime::fromTime_t(it3->second.mLastMessageTs);
|
||||
i.subscribeFlags = 0; // irrelevant here
|
||||
i.publishKey = false ; // IS_GROUP_PUBLISHER(groupInfo.mSubscribeFlags);
|
||||
i.adminKey = false ; // IS_GROUP_ADMIN(groupInfo.mSubscribeFlags);
|
||||
i.max_visible_posts = it3->second.mNumberOfMessages;
|
||||
group_items.push_back(i);
|
||||
}
|
||||
|
||||
group_items.push_back(i);
|
||||
}
|
||||
|
||||
ui->groupTreeWidget->fillGroupItems(it2->second, group_items);
|
||||
}
|
||||
ui->groupTreeWidget->fillGroupItems(it2->second, group_items);
|
||||
}
|
||||
|
||||
void GxsGroupFrameDialog::todo()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue