From d6dfde9041a05567087a9f19f20fe589a9655fe9 Mon Sep 17 00:00:00 2001
From: Benedikt Meurer <benny@xfce.org>
Date: Wed, 15 Feb 2006 00:06:45 +0000
Subject: [PATCH] 2006-02-15	Benedikt Meurer <benny@xfce.org>

	* THANKS, thunar-uca/thunar-uca-editor.c: Apply patch provided by
	  Nick Schermer <nickschermer@gmail.com> to fix a crash in the
	  thunar-uca plugin if the icon specified for an action cannot
	  be loaded. Bug #1458.




(Old svn revision: 19882)
---
 ChangeLog                      |  7 +++++++
 THANKS                         |  3 +++
 thunar-uca/thunar-uca-editor.c | 20 ++++++++++----------
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ddcd51eae..75f1cebaa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-15	Benedikt Meurer <benny@xfce.org>
+
+	* THANKS, thunar-uca/thunar-uca-editor.c: Apply patch provided by
+	  Nick Schermer <nickschermer@gmail.com> to fix a crash in the
+	  thunar-uca plugin if the icon specified for an action cannot
+	  be loaded. Bug #1458.
+
 2006-02-14	Benedikt Meurer <benny@xfce.org>
 
 	* thunar-vfs/thunar-vfs-xfer.c, thunar-vfs/thunar-vfs-chmod-job.c,
diff --git a/THANKS b/THANKS
index c80a8f59a..d6e0c7d90 100644
--- a/THANKS
+++ b/THANKS
@@ -62,3 +62,6 @@ Other contributors (sorted by name):
  Danny Milosavljevic <danny.milo@gmx.net>
   * patches
 
+ Nick Schermer <nickschermer@gmail.com>
+  * patches
+
diff --git a/thunar-uca/thunar-uca-editor.c b/thunar-uca/thunar-uca-editor.c
index 6e7b536ba..d7032ac1b 100644
--- a/thunar-uca/thunar-uca-editor.c
+++ b/thunar-uca/thunar-uca-editor.c
@@ -724,16 +724,6 @@ thunar_uca_editor_set_icon_name (ThunarUcaEditor *uca_editor,
     {
       /* load the icon from the file */
       icon = gdk_pixbuf_new_from_file (icon_name, NULL);
-
-      /* scale down the icon if required */
-      icon_width = gdk_pixbuf_get_width (icon);
-      icon_height = gdk_pixbuf_get_height (icon);
-      if (G_UNLIKELY (icon_width > 48 || icon_height > 48))
-        {
-          icon_scaled = exo_gdk_pixbuf_scale_ratio (icon, 48);
-          g_object_unref (G_OBJECT (icon));
-          icon = icon_scaled;
-        }
     }
   else if (icon_name != NULL)
     {
@@ -750,6 +740,16 @@ thunar_uca_editor_set_icon_name (ThunarUcaEditor *uca_editor,
   /* setup the icon button */
   if (G_LIKELY (icon != NULL))
     {
+      /* scale down the icon if required */
+      icon_width = gdk_pixbuf_get_width (icon);
+      icon_height = gdk_pixbuf_get_height (icon);
+      if (G_UNLIKELY (icon_width > 48 || icon_height > 48))
+        {
+          icon_scaled = exo_gdk_pixbuf_scale_ratio (icon, 48);
+          g_object_unref (G_OBJECT (icon));
+          icon = icon_scaled;
+        }
+
       /* setup an image for the icon */
       image = gtk_image_new_from_pixbuf (icon);
       gtk_container_add (GTK_CONTAINER (uca_editor->icon_button), image);
-- 
GitLab