logic: search ui performance optimization

* replaced the implementation of the search index. the search index now uses a search-trie. edges have gates that can be used to check if a character can be matched when following the edge.
* SearchMatches now have a text and a list of NameHierarchies that share this node (instead of Ids, so that nodes must be found by names (which makes sure that SearchMatches are still valid after refresh).
* when parsing a project's description the CodeController now looks for NameHierarchies instead of SearchNode names to find ids of linked elements.
This commit is contained in:
malte_langkabel
2016-04-04 15:39:39 +02:00
parent ffc00829f0
commit f3dc12b0ed
21 changed files with 410 additions and 1367 deletions
+5 -5
View File
@@ -396,7 +396,7 @@ void QtSmartSearchBox::onTextEdited(const QString& text)
}
}
if (match.nameHierarchy.size() && !m_allowMultipleElements)
if (match.text.size() && !m_allowMultipleElements)
{
if (m_matches.size())
{
@@ -415,7 +415,7 @@ void QtSmartSearchBox::onTextEdited(const QString& text)
layoutElements();
}
if (match.nameHierarchy.size() || m_elements.size())
if (match.text.size() || m_elements.size())
{
requestAutoCompletions();
}
@@ -446,7 +446,7 @@ void QtSmartSearchBox::onAutocompletionActivated(const SearchMatch& match)
{
addMatchAndUpdate(match);
if (match.nameHierarchy.size())
if (match.text.size())
{
search();
}
@@ -516,7 +516,7 @@ void QtSmartSearchBox::moveCursorTo(int target)
void QtSmartSearchBox::addMatch(const SearchMatch& match)
{
if (!match.nameHierarchy.size())
if (!match.text.size())
{
return;
}
@@ -543,7 +543,7 @@ void QtSmartSearchBox::addMatch(const SearchMatch& match)
void QtSmartSearchBox::addMatchAndUpdate(const SearchMatch& match)
{
if (match.nameHierarchy.size())
if (match.text.size())
{
m_oldText.clear();
clearLineEdit();