Open the search engine even if only the token is typed
So "g" opens Google while "g cat" uses Google to search for cats.
This commit is contained in:
parent
f04861e18c
commit
ba11ec8acd
2 changed files with 3 additions and 2 deletions
|
@ -363,11 +363,11 @@ sokoke_magic_uri (const gchar* uri,
|
||||||
search_uri = NULL;
|
search_uri = NULL;
|
||||||
/* Do we have a keyword and a string? */
|
/* Do we have a keyword and a string? */
|
||||||
parts = g_strsplit (uri, " ", 2);
|
parts = g_strsplit (uri, " ", 2);
|
||||||
if (parts[0] && parts[1])
|
if (parts[0])
|
||||||
if ((item = katze_array_find_token (search_engines, parts[0])))
|
if ((item = katze_array_find_token (search_engines, parts[0])))
|
||||||
{
|
{
|
||||||
search_uri = katze_item_get_uri (item);
|
search_uri = katze_item_get_uri (item);
|
||||||
search = sokoke_search_uri (search_uri, parts[1]);
|
search = sokoke_search_uri (search_uri, parts[1] ? parts[1] : "");
|
||||||
}
|
}
|
||||||
g_strfreev (parts);
|
g_strfreev (parts);
|
||||||
return search;
|
return search;
|
||||||
|
|
|
@ -141,6 +141,7 @@ magic_uri_search (void)
|
||||||
test_input ("max@mustermann.de", NULL);
|
test_input ("max@mustermann.de", NULL);
|
||||||
test_input ("g max@mustermann.de", NULL);
|
test_input ("g max@mustermann.de", NULL);
|
||||||
test_input ("g inurl:http://twotoasts.de bug", NULL);
|
test_input ("g inurl:http://twotoasts.de bug", NULL);
|
||||||
|
test_input ("sm", SM);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue