[empathy] no need to call empathy_theme_manager_find_theme() twice



commit 38ad4dab9cd3d88a2f05fa7e1a37c74e3d361304
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Jul 2 13:50:48 2012 +0200

    no need to call empathy_theme_manager_find_theme() twice

 libempathy-gtk/empathy-theme-manager.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/libempathy-gtk/empathy-theme-manager.c b/libempathy-gtk/empathy-theme-manager.c
index 4854a96..c28b720 100644
--- a/libempathy-gtk/empathy-theme-manager.c
+++ b/libempathy-gtk/empathy-theme-manager.c
@@ -141,18 +141,12 @@ theme_manager_notify_theme_cb (GSettings *gsettings_chat,
 
   theme = g_settings_get_string (gsettings_chat, key);
 
-  if (empathy_theme_manager_find_theme (theme) != NULL)
-    {
-      path = empathy_theme_manager_find_theme (theme);
-      g_free (theme);
-    }
-  else
+  path = empathy_theme_manager_find_theme (theme);
+  if (path == NULL)
     {
       g_warning ("Can't find theme: %s; fallback to 'Classic'",
           theme);
 
-      g_free (theme);
-
       path = empathy_theme_manager_find_theme ("Classic");
       if (path == NULL)
         g_critical ("Can't find 'Classic theme");
@@ -167,6 +161,7 @@ theme_manager_notify_theme_cb (GSettings *gsettings_chat,
   theme_manager_emit_changed (self);
 
   g_free (path);
+  g_free (theme);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]