ui: Fixed activating history item from menu showed wrong symbol (issue #572)

* Refactored SearchMatch: removed delimiter, added tokenName
* Refactored MessageActivateTokens: removed tokenNames
* Restore from SearchMatches from NameHierarchies of tokens
This commit is contained in:
Eberhard Graether
2018-06-30 02:16:03 +02:00
parent 84ddb4ba21
commit 6794b61fab
18 changed files with 115 additions and 104 deletions
+23 -1
View File
@@ -1,5 +1,27 @@
#include "data/access/StorageAccess.h"
StorageAccess::~StorageAccess()
std::pair<std::vector<Id>, std::vector<SearchMatch>> StorageAccess::getNodeIdsAndSearchMatchesForNameHierarchies(
const std::vector<NameHierarchy> nameHierarchies) const
{
std::vector<Id> tokenIds = getNodeIdsForNameHierarchies(nameHierarchies);
std::vector<SearchMatch> matches;
if (tokenIds.size())
{
matches = getSearchMatchesForTokenIds(tokenIds);
}
else
{
for (const NameHierarchy& name : nameHierarchies)
{
matches.push_back(SearchMatch(name.getQualifiedName()));
}
if (!matches.size())
{
matches.push_back(SearchMatch(L"<invalid>"));
}
}
return std::make_pair(tokenIds, matches);
}