--- /dev/null
+
+[Google]
+name=Google
+text=Web Search
+uri=http://www.google.com/search?q=%s
+icon=
+token=g
+
+[Wikipedia]
+name=Wikipedia
+text=The free encyclopedia
+uri=http://en.wikipedia.org/wiki/%s
+icon=
+token=wp
+
+[TheFreeDictionary]
+name=The Free Dictionary
+text=Dictionary, Encyclopedia and Thesaurus
+uri=http://www.thefreedictionary.com/%s
+icon=
+token=fd
katze_assign (config_file, build_config_filename ("search"));
error = NULL;
search_engines = search_engines_new_from_file (config_file, &error);
- if (error)
+ if (!error && katze_array_is_empty (search_engines))
+ {
+ const gchar* const * config_dirs = g_get_system_config_dirs ();
+ i = 0;
+ while (config_dirs[i])
+ {
+ g_object_unref (search_engines);
+ katze_assign (config_file,
+ g_build_filename (config_dirs[i], PACKAGE_NAME, "search", NULL));
+ search_engines = search_engines_new_from_file (config_file, NULL);
+ if (!katze_array_is_empty (search_engines))
+ continue;
+ i++;
+ }
+ if (katze_array_is_empty (search_engines))
+ {
+ g_object_unref (search_engines);
+ katze_assign (config_file,
+ g_build_filename (SYSCONFDIR, "xdg", PACKAGE_NAME, "search", NULL));
+ search_engines = search_engines_new_from_file (config_file, NULL);
+ }
+ }
+ else if (error)
{
- /* FIXME: We may have a "file empty" error, how do we recognize that?
if (error->code != G_FILE_ERROR_NOENT)
g_string_append_printf (error_messages,
_("The search engines couldn't be loaded. %s\n"),
- error->message); */
+ error->message);
g_error_free (error);
}
bookmarks = katze_array_new (KATZE_TYPE_ARRAY);
nls = 'no '
conf.define ('ENABLE_NLS', [0,1][nls == 'yes'])
- dirname_default ('LIBDIR', os.path.join (conf.env['PREFIX'], 'lib'))
dirname_default ('DATADIR', os.path.join (conf.env['PREFIX'], 'share'))
dirname_default ('DOCDIR', os.path.join (conf.env['DATADIR'], 'doc'))
+ dirname_default ('LIBDIR', os.path.join (conf.env['PREFIX'], 'lib'))
+ dirname_default ('SYSCONFDIR', os.path.join (conf.env['PREFIX'], 'etc'))
if option_enabled ('apidocs'):
conf.find_program ('gtkdoc-scan', var='GTKDOC_SCAN')
bld.install_files ('${DOCDIR}/' + APPNAME + '/', \
'AUTHORS ChangeLog COPYING EXPAT README TRANSLATE')
+ # Install default configuration
+ bld.install_files ('${SYSCONFDIR}/xdg/' + APPNAME + '/', 'data/search')
+
if bld.env['RST2HTML']:
# FIXME: Build only if needed
if not os.access (blddir, os.F_OK):