From: martin-s Date: Mon, 16 Jun 2008 21:44:24 +0000 (+0000) Subject: Fix:gui_internal:Fixed crash if icons are missing and bad setting in configure X-Git-Tag: navit-0.5.0.5194svn~4023 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8da0cbcf25c698d4f52e7fb9fc90818b822a015;p=profile%2Fivi%2Fnavit.git Fix:gui_internal:Fixed crash if icons are missing and bad setting in configure git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1133 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/configure.in b/navit/configure.in index 49aa0cd..8c21717 100644 --- a/navit/configure.in +++ b/navit/configure.in @@ -450,11 +450,11 @@ AM_CONDITIONAL(USE_BINDING_DBUS, test "x${enable_binding_dbus}" = "xyes") # svg AC_ARG_ENABLE(svg, [ --disable-svg disable Scalable Vector Graphics], enable_svg=$enableval, enable_svg=yes) AC_ARG_ENABLE(svg2png, [ --disable-svg2png disable conversion of svgs to pngs], enable_svg2png=$enableval, enable_svg2png=yes) -AC_ARG_ENABLE(svg2png_scaling, [ --enable-svg2png-scaling enable conversion of svgs to pngs with specified sizes], SVG2PNG_SCALES=$enableval, SVG2PNG_SCALES="8 16 32 48") +AC_ARG_ENABLE(svg2png_scaling, [ --enable-svg2png-scaling enable conversion of svgs to pngs with specified sizes], SVG2PNG_SCALES=$enableval, SVG2PNG_SCALES="8 16 32 48 96") if test "x${enable_svg2png}" = "xyes" ; then AC_PATH_PROG([KSVGTOPNG], [ksvgtopng], []) if test ! -x "$KSVGTOPNG"; then - enable_svg2png = "no" + enable_svg2png="no" fi fi AC_SUBST(SVG2PNG_SCALES) diff --git a/navit/navit/gui/internal/gui_internal.c b/navit/navit/gui/internal/gui_internal.c index 65d9a5c..df22cd7 100644 --- a/navit/navit/gui/internal/gui_internal.c +++ b/navit/navit/gui/internal/gui_internal.c @@ -354,6 +354,7 @@ gui_internal_button_attr_update(struct gui_priv *this, struct widget *w) struct widget *wi; int is_on=0; struct attr curr; + GList *l; if (w->get_attr(w->instance, w->on.type, &curr, NULL)) is_on=curr.u.data == w->on.u.data; @@ -361,10 +362,13 @@ gui_internal_button_attr_update(struct gui_priv *this, struct widget *w) if (w->redraw) this->redraw=1; w->is_on=is_on; - wi=g_list_first(w->children)->data; - if (wi->img) - graphics_image_free(this->gra, wi->img); - wi->img=image_new_xs(this, is_on ? "gui_active" : "gui_inactive"); + l=g_list_first(w->children); + if (l) { + wi=l->data; + if (wi->img) + graphics_image_free(this->gra, wi->img); + wi->img=image_new_xs(this, is_on ? "gui_active" : "gui_inactive"); + } if (w->is_on && w->off.type == attr_none) w->state &= ~STATE_SENSITIVE; else