[gthumb] location chooser: fixed run-time warning



commit f8ca2020985f929297aa2730c12573a464290d8b
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Oct 30 22:55:04 2014 +0100

    location chooser: fixed run-time warning
    
    do not use the arrow if it could not be found

 gthumb/gth-location-chooser.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gthumb/gth-location-chooser.c b/gthumb/gth-location-chooser.c
index d01440c..8575815 100644
--- a/gthumb/gth-location-chooser.c
+++ b/gthumb/gth-location-chooser.c
@@ -641,7 +641,7 @@ get_combo_box_arrow (GtkWidget *widget,
 static gboolean
 show_combo_box_arrow (GthLocationChooser *self)
 {
-       if (self->priv->relief == GTK_RELIEF_NONE)
+       if ((self->priv->arrow != NULL) && (self->priv->relief == GTK_RELIEF_NONE))
                gtk_widget_show (self->priv->arrow);
 
        return FALSE;
@@ -651,7 +651,7 @@ show_combo_box_arrow (GthLocationChooser *self)
 static gboolean
 hide_combo_box_arrow (GthLocationChooser *self)
 {
-       if (self->priv->relief == GTK_RELIEF_NONE)
+       if ((self->priv->arrow != NULL) && (self->priv->relief == GTK_RELIEF_NONE))
                gtk_widget_hide (self->priv->arrow);
 
        return FALSE;
@@ -688,7 +688,8 @@ gth_location_chooser_set_relief (GthLocationChooser *self,
                                                  self);
                }
 
-               gtk_widget_set_visible (self->priv->arrow, self->priv->relief != GTK_RELIEF_NONE);
+               if (self->priv->arrow != NULL)
+                       gtk_widget_set_visible (self->priv->arrow, self->priv->relief != GTK_RELIEF_NONE);
        }
 
        g_object_notify (G_OBJECT (self), "relief");


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