logic: preselecting SearchNodes for autocompletion by prefiltering the Graph with the entered Query
This change only shows matches in the autocompletion list that are prefiltered by the already entered query. The autocompletion now also shows up after an operator of type . or > has been entered to show an alphabetical list of possible tokens.
This commit is contained in:
@@ -120,7 +120,7 @@ namespace utility
|
||||
{
|
||||
if (a.size() == b.size())
|
||||
{
|
||||
for (int i = 0; i < a.size(); i++)
|
||||
for (size_t i = 0; i < a.size(); i++)
|
||||
{
|
||||
if (tolower(a[i]) != tolower(b[i]))
|
||||
{
|
||||
@@ -131,4 +131,22 @@ namespace utility
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string replace(std::string str, const std::string& from, const std::string& to)
|
||||
{
|
||||
size_t pos = 0;
|
||||
|
||||
if (from.size() == 0)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
while ((pos = str.find(from, pos)) != std::string::npos)
|
||||
{
|
||||
str.replace(pos, from.length(), to);
|
||||
pos += to.length();
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user