Patch by: Aprotim Sanyal <aprotim@google.com>
2008-07-15 Jens Granseuer <jensgr@gmx.net> Patch by: Aprotim Sanyal <aprotim@google.com> * gnome-da-xml.c: (gnome_da_xml_load_list): make it possible for apps to install additional XML files to extend the list of available applications (bug #527304) svn path=/trunk/; revision=8782
This commit is contained in:
parent
536abe1a33
commit
d0e7d2a09c
2 changed files with 28 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
2008-07-15 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
Patch by: Aprotim Sanyal <aprotim@google.com>
|
||||
|
||||
* gnome-da-xml.c: (gnome_da_xml_load_list): make it possible for apps
|
||||
to install additional XML files to extend the list of available
|
||||
applications (bug #527304)
|
||||
|
||||
2008-06-15 Thomas Wood <thos@gnome.org>
|
||||
|
||||
* Makefile.am:
|
||||
|
|
|
@ -248,7 +248,7 @@ gnome_da_xml_load_xml (GnomeDACapplet *capplet, const gchar * filename)
|
|||
visual_item->run_at_startup = gnome_da_xml_get_bool (element, "run-at-startup");
|
||||
|
||||
capplet->visual_ats = g_list_append (capplet->visual_ats, visual_item);
|
||||
}
|
||||
}
|
||||
else
|
||||
g_free (executable);
|
||||
}
|
||||
|
@ -284,6 +284,9 @@ void
|
|||
gnome_da_xml_load_list (GnomeDACapplet *capplet)
|
||||
{
|
||||
gchar *filename;
|
||||
gchar *dirname;
|
||||
const gchar *extra_file;
|
||||
GDir *app_dir;
|
||||
|
||||
filename = g_build_filename (GNOMECC_DATA_DIR,
|
||||
"gnome-default-applications.xml",
|
||||
|
@ -296,6 +299,22 @@ gnome_da_xml_load_list (GnomeDACapplet *capplet)
|
|||
|
||||
if (capplet->web_browsers == NULL)
|
||||
gnome_da_xml_load_xml (capplet, "./gnome-default-applications.xml");
|
||||
|
||||
dirname = g_build_filename (GNOMECC_DATA_DIR, "default-apps", NULL);
|
||||
app_dir = g_dir_open (dirname, 0, NULL);
|
||||
|
||||
if (app_dir != NULL) {
|
||||
while ((extra_file = g_dir_read_name (app_dir)) != NULL) {
|
||||
filename = g_build_filename (dirname, extra_file, NULL);
|
||||
|
||||
if (g_str_has_suffix (filename, ".xml"))
|
||||
gnome_da_xml_load_xml (capplet, filename);
|
||||
|
||||
g_free (filename);
|
||||
}
|
||||
g_dir_close (app_dir);
|
||||
}
|
||||
g_free (dirname);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue