]> git.0d.be Git - empathy.git/commitdiff
no need to call empathy_theme_manager_find_theme() twice
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 2 Jul 2012 11:50:48 +0000 (13:50 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 2 Jul 2012 11:50:48 +0000 (13:50 +0200)
libempathy-gtk/empathy-theme-manager.c

index 4854a9632948e6ff3b2627f9104652ef31d701ae..c28b7204f632d96b4a8a954d1d343bcede05f81e 100644 (file)
@@ -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