[maemo-commits] [maemo-commits] r10282 - in projects/haf/branches/hildon-libs/hildon-1: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Mar 1 14:09:53 EET 2007
Author: mdk
Date: 2007-03-01 14:09:53 +0200 (Thu, 01 Mar 2007)
New Revision: 10282

Modified:
   projects/haf/branches/hildon-libs/hildon-1/ChangeLog.2
   projects/haf/branches/hildon-libs/hildon-1/src/hildon-banner.c
Log:
Small fix, check for NULL before comparing strings.


Modified: projects/haf/branches/hildon-libs/hildon-1/ChangeLog.2
===================================================================
--- projects/haf/branches/hildon-libs/hildon-1/ChangeLog.2	2007-03-01 12:06:43 UTC (rev 10281)
+++ projects/haf/branches/hildon-libs/hildon-1/ChangeLog.2	2007-03-01 12:09:53 UTC (rev 10282)
@@ -1,5 +1,10 @@
 2007-03-01  Michael Dominic Kostrzewa  <michael.kostrzewa at nokia.com> 
 
+	* src/hildon-banner.c: Small fix, check for NULL before comparing
+	strings.
+
+2007-03-01  Michael Dominic Kostrzewa  <michael.kostrzewa at nokia.com> 
+
 	* src/hildon-banner.c: Do not set the text on the label if it's
 	exactly same as the existing text. Fixes some wrapping problems. Fixes
 	NB#50496.

Modified: projects/haf/branches/hildon-libs/hildon-1/src/hildon-banner.c
===================================================================
--- projects/haf/branches/hildon-libs/hildon-1/src/hildon-banner.c	2007-03-01 12:06:43 UTC (rev 10281)
+++ projects/haf/branches/hildon-libs/hildon-1/src/hildon-banner.c	2007-03-01 12:09:53 UTC (rev 10282)
@@ -1026,6 +1026,7 @@
 {
     GtkLabel *label;
     HildonBannerPrivate *priv;
+    const gchar *existing_text;
 
     g_return_if_fail (HILDON_IS_BANNER (self));
 
@@ -1033,7 +1034,11 @@
     g_assert (priv);
 
     label = GTK_LABEL (priv->label);
-    if (strcmp (gtk_label_get_text (label), text) != 0)
+    existing_text = gtk_label_get_text (label);
+
+    if (existing_text != NULL && 
+        text != NULL          &&
+        strcmp (existing_text, text) != 0)
             gtk_label_set_text (label, text);
 
     hildon_banner_check_position (GTK_WIDGET (self));


More information about the maemo-commits mailing list