[gnome-calendar] utils: make NULL comparison explicit



commit c256bec634dc7c6604ae790b9b0ccc2a59d4f3eb
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Sat May 16 16:32:07 2015 -0400

    utils: make NULL comparison explicit

 src/gcal-utils.c |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/gcal-utils.c b/src/gcal-utils.c
index 83db78d..3177591 100644
--- a/src/gcal-utils.c
+++ b/src/gcal-utils.c
@@ -661,24 +661,24 @@ uri_get_fields (const gchar  *uri,
     {
       valid = TRUE;
 
-      if (schema)
+      if (schema != NULL)
         *schema = g_match_info_fetch (match, 1);
 
-      if (host)
+      if (host != NULL)
         *host = g_match_info_fetch (match, 2);
 
-      if (path)
+      if (path != NULL)
         *path = g_match_info_fetch (match, 3);
     }
   else
     {
-      if (schema)
+      if (schema != NULL)
         *schema = NULL;
 
-      if (host)
+      if (host != NULL)
         *host = NULL;
 
-      if (path)
+      if (path != NULL)
         *path = NULL;
     }
 
@@ -699,8 +699,15 @@ get_source_parent_name_color (GcalManager  *manager,
 
   parent_source = gcal_manager_get_source (manager, e_source_get_parent (source));
 
-  if (name)
+  if (name != NULL)
     *name = e_source_dup_display_name (parent_source);
-  if (color)
-    *color = g_strdup (get_color_name_from_source (parent_source));
+
+  if (color != NULL)
+    {
+      GdkRGBA c;
+
+      get_color_name_from_source (parent_source, &c);
+
+      *color = gdk_rgba_to_string (&c);
+    }
 }


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