From 9f148e53e8086daff05f7ce9801a405c61182864 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Mon, 29 Jun 2009 20:07:33 -0400 Subject: List installed adium themes --- libempathy-gtk/empathy-theme-adium.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'libempathy-gtk/empathy-theme-adium.c') diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index aab1f6f3d..0464a6193 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -820,6 +820,15 @@ empathy_adium_path_is_valid (const gchar *path) gboolean ret; gchar *file; + /* The theme is not valid if there is no Info.plist */ + file = g_build_filename (path, "Contents", "Info.plist", + NULL); + ret = g_file_test (file, G_FILE_TEST_EXISTS); + g_free (file); + + if (ret == FALSE) + return ret; + /* We ship a default Template.html as fallback if there is any problem * with the one inside the theme. The only other required file is * Content.html for incoming messages (outgoing fallback to use @@ -845,10 +854,15 @@ empathy_adium_info_new (const gchar *path) value = empathy_plist_parse_from_file (file); g_free (file); - if (value) { - info = g_value_dup_boxed (value); - tp_g_value_slice_free (value); - } + if (value == NULL) + return NULL; + + info = g_value_dup_boxed (value); + tp_g_value_slice_free (value); + + /* Insert the theme's path into the hash table, + * keys have to be dupped */ + tp_asv_set_string (info, g_strdup ("path"), path); return info; } -- cgit v1.2.3