diff options
author | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-06-30 08:07:33 +0800 |
---|---|---|
committer | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-07-03 02:40:25 +0800 |
commit | 9f148e53e8086daff05f7ce9801a405c61182864 (patch) | |
tree | e158aefcc15b3e797b45d8a32b4d70b08451b549 /libempathy-gtk/empathy-theme-adium.c | |
parent | 5dae9d1185b972651a7c7e8d4431f8dcdd2e0cd3 (diff) | |
download | gsoc2013-empathy-9f148e53e8086daff05f7ce9801a405c61182864.tar gsoc2013-empathy-9f148e53e8086daff05f7ce9801a405c61182864.tar.gz gsoc2013-empathy-9f148e53e8086daff05f7ce9801a405c61182864.tar.bz2 gsoc2013-empathy-9f148e53e8086daff05f7ce9801a405c61182864.tar.lz gsoc2013-empathy-9f148e53e8086daff05f7ce9801a405c61182864.tar.xz gsoc2013-empathy-9f148e53e8086daff05f7ce9801a405c61182864.tar.zst gsoc2013-empathy-9f148e53e8086daff05f7ce9801a405c61182864.zip |
List installed adium themes
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r-- | libempathy-gtk/empathy-theme-adium.c | 22 |
1 files changed, 18 insertions, 4 deletions
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; } |