char *uri;
} Searchengine;
+static GSList *searchengines;
+static char *default_handle = NULL;
+
static GSList *find(const char *handle);
static gboolean is_valid_uri(const char *uri);
static void free_searchengine(Searchengine *se);
void searchengine_cleanup(void)
{
- if (vb.behave.searchengines) {
- g_slist_free_full(vb.behave.searchengines, (GDestroyNotify)free_searchengine);
+ if (searchengines) {
+ g_slist_free_full(searchengines, (GDestroyNotify)free_searchengine);
}
}
s->handle = g_strdup(handle);
s->uri = g_strdup(uri);
- vb.behave.searchengines = g_slist_prepend(vb.behave.searchengines, s);
+ searchengines = g_slist_prepend(searchengines, s);
return true;
}
if (list) {
free_searchengine((Searchengine*)list->data);
- vb.behave.searchengines = g_slist_delete_link(vb.behave.searchengines, list);
+ searchengines = g_slist_delete_link(searchengines, list);
return true;
}
{
/* do not check if the search engin exists to be able to set the default
* before defining the search engines */
- OVERWRITE_STRING(vb.behave.searchengine_default, handle);
+ OVERWRITE_STRING(default_handle, handle);
return true;
}
}
}
- if (!tmpl && (l = find(vb.behave.searchengine_default))) {
+ if (!tmpl && (l = find(default_handle))) {
tmpl = ((Searchengine*)l->data)->uri;
query = soup_uri_encode(string, "&");
}
static GSList *find(const char *handle)
{
GSList *s;
- for (s = vb.behave.searchengines; s != NULL; s = s->next) {
+ for (s = searchengines; s != NULL; s = s->next) {
if (!strcmp(((Searchengine*)s->data)->handle, handle)) {
return s;
}