added missing cleaning of distant search results in GUI

This commit is contained in:
csoler 2020-07-03 22:48:33 +02:00
parent 6510af7ab6
commit 4d872d5778
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
4 changed files with 16 additions and 1 deletions

View File

@ -359,13 +359,21 @@ void GxsGroupFrameDialog::removeCurrentSearch()
mSearchGroupsItems.erase(it);
mKnownGroups.erase(search_request_id);
clearDistantSearchResults(search_request_id);
}
void GxsGroupFrameDialog::removeAllSearches()
{
for(auto it(mSearchGroupsItems.begin());it!=mSearchGroupsItems.end();++it)
ui->groupTreeWidget->removeSearchItem(it->second) ;
{
TurtleRequestId search_request_id = 0 ;
if(ui->groupTreeWidget->isSearchRequestItem(point,search_request_id))
clearDistantSearchResults(search_request_id);
ui->groupTreeWidget->removeSearchItem(it->second) ;
}
mSearchGroupsItems.clear();
mKnownGroups.clear();
}

View File

@ -162,6 +162,7 @@ private:
virtual RsGxsCommentService *getCommentService() { return NULL; }
virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &/*grpId*/, const RsGxsMessageId &/*msgId*/) { return NULL; }
virtual bool getDistantSearchResults(TurtleRequestId /* id */, std::map<RsGxsGroupId,RsGxsGroupSearchResults>& /* group_infos */){ return false ;}
virtual void clearDistantSearchResults(TurtleRequestId /* id */) {}
virtual RsGxsGenericGroupData *getDistantSearchResultGroupData(const RsGxsGroupId& group_id){ return nullptr ;}
void initUi();

View File

@ -396,6 +396,11 @@ void GxsChannelDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *gro
groupItemInfo.description = QString::fromUtf8(channelGroupData->mDescription.c_str());
}
void GxsChannelDialog::clearDistantSearchResults(TurtleRequestId id)
{
rsGxsChannels->clearDistantSearchResults(id);
}
TurtleRequestId GxsChannelDialog::distantSearch(const QString& search_string)
{
return rsGxsChannels->turtleSearchRequest(search_string.toStdString()) ;

View File

@ -48,6 +48,7 @@ protected:
virtual TurtleRequestId distantSearch(const QString& search_string) override;
virtual void checkRequestGroup(const RsGxsGroupId& grpId) override ;
virtual void clearDistantSearchResults(TurtleRequestId id) override;
// Implementation of some abstract methods in GxsGroupFrameDialog