diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-07-02 18:57:36 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-07-02 18:57:36 +0800 |
commit | 5e112661cca767870225936428515a82b2f6f82c (patch) | |
tree | 24ebab468dcfd84b2f730e86f04a722b03683757 | |
parent | 74895e8b815cbed7a041fcbc8e3234ae6df102ae (diff) | |
download | gsoc2013-empathy-5e112661cca767870225936428515a82b2f6f82c.tar gsoc2013-empathy-5e112661cca767870225936428515a82b2f6f82c.tar.gz gsoc2013-empathy-5e112661cca767870225936428515a82b2f6f82c.tar.bz2 gsoc2013-empathy-5e112661cca767870225936428515a82b2f6f82c.tar.lz gsoc2013-empathy-5e112661cca767870225936428515a82b2f6f82c.tar.xz gsoc2013-empathy-5e112661cca767870225936428515a82b2f6f82c.tar.zst gsoc2013-empathy-5e112661cca767870225936428515a82b2f6f82c.zip |
add empathy_theme_manager_dup_theme_name_from_path()
-rw-r--r-- | libempathy-gtk/empathy-theme-manager.c | 20 | ||||
-rw-r--r-- | libempathy-gtk/empathy-theme-manager.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-theme-manager.c b/libempathy-gtk/empathy-theme-manager.c index 9999de08d..1f6611663 100644 --- a/libempathy-gtk/empathy-theme-manager.c +++ b/libempathy-gtk/empathy-theme-manager.c @@ -416,3 +416,23 @@ empathy_theme_manager_find_theme (const gchar *name) return NULL; } + +gchar * +empathy_theme_manager_dup_theme_name_from_path (const gchar *path) +{ + gchar *fullname, *result; + gchar **tmp; + + if (path == NULL) + return NULL; + + fullname = g_path_get_basename (path); + if (!g_str_has_suffix (fullname, ".AdiumMessageStyle")) + return NULL; + + tmp = g_strsplit (fullname, ".AdiumMessageStyle", 0); + result = g_strdup (tmp[0]); + + g_strfreev (tmp); + return result; +} diff --git a/libempathy-gtk/empathy-theme-manager.h b/libempathy-gtk/empathy-theme-manager.h index ab756cc50..d4d755ba0 100644 --- a/libempathy-gtk/empathy-theme-manager.h +++ b/libempathy-gtk/empathy-theme-manager.h @@ -72,6 +72,8 @@ GList * empathy_theme_manager_get_adium_themes (void); EmpathyChatView * empathy_theme_manager_create_view (EmpathyThemeManager *self); gchar * empathy_theme_manager_find_theme (const gchar *name); +gchar * empathy_theme_manager_dup_theme_name_from_path (const gchar *path); + G_END_DECLS #endif /* __EMPATHY_THEME_MANAGER_H__ */ |