Revision: 1441
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1441&view=rev
Author:   zas_
Date:     2009-02-28 20:24:42 +0000 (Sat, 28 Feb 2009)

Log Message:
-----------
Prevent Gtk assertion failures when no icon is set.

Modified Paths:
--------------
    trunk/src/layout_util.c
    trunk/src/pixbuf_util.c

Modified: trunk/src/layout_util.c
===================================================================
--- trunk/src/layout_util.c     2009-02-28 20:13:11 UTC (rev 1440)
+++ trunk/src/layout_util.c     2009-02-28 20:24:42 UTC (rev 1441)
@@ -1652,7 +1652,7 @@
                EditorDescription *editor = work->data;
                GtkActionEntry entry = { editor->key, NULL, editor->name, 
editor->hotkey, NULL, G_CALLBACK(layout_menu_edit_cb) };
                
-               if (register_theme_icon_as_stock(editor->key, editor->icon))
+               if (editor->icon && register_theme_icon_as_stock(editor->key, 
editor->icon))
                        {
                        entry.stock_id = editor->key;
                        }

Modified: trunk/src/pixbuf_util.c
===================================================================
--- trunk/src/pixbuf_util.c     2009-02-28 20:13:11 UTC (rev 1440)
+++ trunk/src/pixbuf_util.c     2009-02-28 20:24:42 UTC (rev 1441)
@@ -166,15 +166,18 @@
        GError *error = NULL;
 
        icon_theme = gtk_icon_theme_get_default();
-       pixbuf = gtk_icon_theme_load_icon (icon_theme,
+       pixbuf = gtk_icon_theme_load_icon(icon_theme,
                            icon, /* icon name */
                            64, /* size */
                            0,  /* flags */
                            &error);
        if (!pixbuf) 
                {
-               DEBUG_1("Couldn't load icon: %s", error->message);
-               g_error_free(error);
+               if (error)
+                       {
+                       DEBUG_1("Couldn't load icon: %s", error->message);
+                       g_error_free(error);
+                       }
                return FALSE;
                }
        


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to