logic: make SearchController only listen to MessageActivateTokens

This change makes MessageActivateTokens being used consistently throughout all Controllers. The FeatureController
accepts all incoming activation messages and turns them into MessageActivateTokens, which are then accepted by all
view controllers.
This commit is contained in:
Eberhard Graether
2015-10-02 10:18:17 +02:00
parent 2704d47cd8
commit a855e14ebf
7 changed files with 61 additions and 54 deletions
+36
View File
@@ -784,6 +784,42 @@ std::vector<SearchMatch> Storage::getAutocompletionMatches(const std::string& qu
return matches;
}
std::vector<SearchMatch> Storage::getSearchMatchesForTokenIds(const std::vector<Id>& tokenIds) const
{
std::vector<SearchMatch> matches;
for (Id tokenId : tokenIds)
{
SearchMatch match;
if (m_sqliteStorage.isFile(tokenId))
{
StorageFile file = m_sqliteStorage.getFileById(tokenId);
match.fullName = m_tokenIndex.getNameHierarchyForTokenId(tokenId).getFullName();
match.nodeType = Node::NODE_FILE;
}
else if (m_sqliteStorage.isNode(tokenId))
{
StorageNode node = m_sqliteStorage.getNodeById(tokenId);
match.fullName = m_tokenIndex.getNameHierarchyForTokenId(tokenId).getFullName();
match.nodeType = Node::intToType(node.type);
}
else
{
continue;
}
match.tokenIds.insert(tokenId);
match.searchType = SearchMatch::SEARCH_TOKEN;
matches.push_back(match);
}
return matches;
}
std::shared_ptr<Graph> Storage::getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const
{
std::shared_ptr<Graph> g = std::make_shared<Graph>();