Changeset 2177


Ignore:
Timestamp:
06/06/07 16:54:34 (6 years ago)
Author:
njp
Message:

Added some error checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-finger-tool-box.c

    r2158 r2177  
    190190    if ( !priv->background_pixbuf ) 
    191191    { 
    192         gchar *filename; 
    193         if (filename = get_bg_pixmap_name (GTK_WIDGET (self))) 
     192        gchar *filename = NULL; 
     193        if ((filename = get_bg_pixmap_name (GTK_WIDGET (self)))) 
    194194        { 
    195195          priv->background_pixbuf = gdk_pixbuf_new_from_file( filename, NULL); 
     
    212212        g_free (buttonfile); 
    213213    } 
    214     GdkPixbuf* pixbuf = gdk_pixbuf_scale_simple( priv->background_pixbuf, a->width, a->height, GDK_INTERP_BILINEAR ); 
     214    GdkPixbuf* pixbuf = NULL; 
    215215    guint w = gdk_pixbuf_get_width( priv->button_pixbuf ); 
    216216    guint h = gdk_pixbuf_get_height( priv->button_pixbuf ); 
     
    218218    guint y = 0; 
    219219 
    220     gdk_pixbuf_copy_area( priv->background_pixbuf, 0, 0, gdk_pixbuf_get_width( priv->background_pixbuf ), gdk_pixbuf_get_height( priv->background_pixbuf ), pixbuf, 0, 0 ); 
    221  
     220    if (GDK_IS_PIXBUF (priv->background_pixbuf)) 
     221    { 
     222        pixbuf = gdk_pixbuf_scale_simple( priv->background_pixbuf,  
     223                                                     a->width, a->height, 
     224                                                     GDK_INTERP_BILINEAR ); 
     225        gdk_pixbuf_copy_area( priv->background_pixbuf, 0, 0,  
     226                              gdk_pixbuf_get_width( priv->background_pixbuf ), 
     227                              gdk_pixbuf_get_height( priv->background_pixbuf ), 
     228                              pixbuf, 0, 0 ); 
     229    } 
    222230    guint composite_num; 
    223231    if ( maxButtonsPerPage == 0 ) 
Note: See TracChangeset for help on using the changeset viewer.