ui: Tab in search completes up to next ::, Delete erases to last ::
bug id = 133
This commit is contained in:
@@ -177,6 +177,17 @@ bool HierarchyCache::isChildOfVisibleNodeOrInvisible(Id nodeId) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HierarchyCache::nodeHasChildren(Id nodeId) const
|
||||
{
|
||||
HierarchyNode* node = getNode(nodeId);
|
||||
if (node)
|
||||
{
|
||||
return node->getChildren().size();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
HierarchyCache::HierarchyNode* HierarchyCache::getNode(Id nodeId) const
|
||||
{
|
||||
std::map<Id, std::shared_ptr<HierarchyNode>>::const_iterator it = m_nodes.find(nodeId);
|
||||
|
||||
@@ -21,6 +21,7 @@ public:
|
||||
void addFirstVisibleChildIdsForNodeId(Id nodeId, std::vector<Id>* nodeIds) const;
|
||||
|
||||
bool isChildOfVisibleNodeOrInvisible(Id nodeId) const;
|
||||
bool nodeHasChildren(Id nodeId) const;
|
||||
|
||||
private:
|
||||
class HierarchyNode
|
||||
|
||||
@@ -589,6 +589,11 @@ std::vector<SearchMatch> PersistentStorage::getAutocompletionMatches(const std::
|
||||
const StorageNode& node = storageNodesMap[elementId];
|
||||
match.nameHierarchies.push_back(NameHierarchy::deserialize(node.serializedName));
|
||||
|
||||
if (!match.hasChildren)
|
||||
{
|
||||
match.hasChildren = m_hierarchyCache.nodeHasChildren(node.id);
|
||||
}
|
||||
|
||||
if (!firstNode)
|
||||
{
|
||||
firstNode = &node;
|
||||
|
||||
@@ -91,6 +91,7 @@ SearchMatch::CommandType SearchMatch::getCommandType(const std::string& name)
|
||||
SearchMatch::SearchMatch()
|
||||
: typeName("")
|
||||
, searchType(SEARCH_NONE)
|
||||
, hasChildren(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -98,6 +99,7 @@ SearchMatch::SearchMatch(const std::string& query)
|
||||
: text(query)
|
||||
, typeName("")
|
||||
, searchType(SEARCH_NONE)
|
||||
, hasChildren(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,8 @@ struct SearchMatch
|
||||
std::vector<size_t> indices;
|
||||
|
||||
std::vector<NameHierarchy> nameHierarchies;
|
||||
|
||||
bool hasChildren;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user