Updating branch refs/heads/master
         to add24d3e35db5724a3b6a1efe47274fc809b4992 (commit)
       from 034541e4cf6981c61a453c4054edff5eec42d3d1 (commit)

commit add24d3e35db5724a3b6a1efe47274fc809b4992
Author: Harald Judt <h.j...@gmx.at>
Date:   Fri Mar 29 00:45:24 2013 +0100

    Add a new public function for getting the user icon themes path.

 panel-plugin/weather-icon.c |   17 ++++++++++++++---
 panel-plugin/weather-icon.h |    2 ++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/weather-icon.c b/panel-plugin/weather-icon.c
index b3c77e1..e8680ec 100644
--- a/panel-plugin/weather-icon.c
+++ b/panel-plugin/weather-icon.c
@@ -369,6 +369,19 @@ find_themes_in_dir(const gchar *path)
 
 
 /*
+ * Returns the user icon theme directory as a string which needs to be
+ * freed by the calling function.
+ */
+gchar *
+get_user_icons_dir(void)
+{
+    return g_strconcat(g_get_user_config_dir(), G_DIR_SEPARATOR_S,
+                       "xfce4", G_DIR_SEPARATOR_S, "weather",
+                       G_DIR_SEPARATOR_S, "icons", NULL);
+}
+
+
+/*
  * Find all available themes in user's config dir and at the install
  * location.
  */
@@ -381,9 +394,7 @@ find_icon_themes(void)
     themes = g_array_new(FALSE, TRUE, sizeof(icon_theme *));
 
     /* look in user directory first */
-    dir = g_strconcat(g_get_user_config_dir(), G_DIR_SEPARATOR_S,
-                      "xfce4", G_DIR_SEPARATOR_S, "weather",
-                      G_DIR_SEPARATOR_S, "icons", NULL);
+    dir = get_user_icons_dir();
     found = find_themes_in_dir(dir);
     g_free(dir);
     if (found) {
diff --git a/panel-plugin/weather-icon.h b/panel-plugin/weather-icon.h
index 6cc3984..41a007e 100644
--- a/panel-plugin/weather-icon.h
+++ b/panel-plugin/weather-icon.h
@@ -95,6 +95,8 @@ icon_theme *icon_theme_load_info(const gchar *dir);
 
 icon_theme *icon_theme_load(const gchar *dir);
 
+gchar *get_user_icons_dir(void);
+
 GArray *find_icon_themes(void);
 
 icon_theme *icon_theme_copy(icon_theme *src);
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to