Author: jannis
Date: 2006-10-04 17:05:57 +0000 (Wed, 04 Oct 2006)
New Revision: 23282

Modified:
   libfrap/trunk/libfrap/menu/ChangeLog
   libfrap/trunk/libfrap/menu/frap-menu-item.c
Log:
        * frap-menu-item.c: Make property assignment more clean.

Modified: libfrap/trunk/libfrap/menu/ChangeLog
===================================================================
--- libfrap/trunk/libfrap/menu/ChangeLog        2006-10-04 16:49:36 UTC (rev 
23281)
+++ libfrap/trunk/libfrap/menu/ChangeLog        2006-10-04 17:05:57 UTC (rev 
23282)
@@ -1,5 +1,9 @@
 2006-10-04     Jannis Pohlmann <[EMAIL PROTECTED]>
 
+       * frap-menu-item.c: Make property assignment more clean.
+
+2006-10-04     Jannis Pohlmann <[EMAIL PROTECTED]>
+
        * frap-menu.c: Err, this fixes the <OnlyUnallocated /> check when
          resolving items.
 

Modified: libfrap/trunk/libfrap/menu/frap-menu-item.c
===================================================================
--- libfrap/trunk/libfrap/menu/frap-menu-item.c 2006-10-04 16:49:36 UTC (rev 
23281)
+++ libfrap/trunk/libfrap/menu/frap-menu-item.c 2006-10-04 17:05:57 UTC (rev 
23282)
@@ -288,6 +288,12 @@
 frap_menu_item_init (FrapMenuItem *item)
 {
   item->priv = FRAP_MENU_ITEM_GET_PRIVATE (item);
+  item->priv->icon_name = NULL;
+  item->priv->name = NULL;
+  item->priv->command = NULL;
+  item->priv->desktop_id = NULL;
+  item->priv->filename = NULL;
+  item->priv->categories = NULL;
 }
 
 
@@ -552,7 +558,8 @@
     }
 
   /* Assign the new desktop_id */
-  item->priv->desktop_id = g_strdup (desktop_id);
+  if (G_LIKELY (desktop_id != NULL))
+    item->priv->desktop_id = g_strdup (desktop_id);
 
   /* Notify listeners */
   g_object_notify (G_OBJECT (item), "desktop_id");
@@ -589,7 +596,8 @@
     }
 
   /* Assign the new filename */
-  item->priv->filename = g_strdup (filename);
+  if (G_LIKELY (filename != NULL))
+    item->priv->filename = g_strdup (filename);
 
   /* Notify listeners */
   g_object_notify (G_OBJECT (item), "filename");
@@ -657,7 +665,8 @@
     }
 
   /* Assign new command */
-  item->priv->command = g_strdup (command);
+  if (G_LIKELY (command != NULL))
+    item->priv->command = g_strdup (command);
 
   /* Notify listeners */
   g_object_notify (G_OBJECT (item), "command");
@@ -691,7 +700,8 @@
     }
 
   /* Assign new name */
-  item->priv->name = g_strdup (name);
+  if (G_LIKELY (name != NULL))
+    item->priv->name = g_strdup (name);
 
   /* Notify listeners */
   g_object_notify (G_OBJECT (item), "name");
@@ -725,7 +735,8 @@
     }
 
   /* Assign new icon name */
-  item->priv->icon_name = g_strdup (icon_name);
+  if (G_LIKELY (icon_name != NULL))
+    item->priv->icon_name = g_strdup (icon_name);
 
   /* Notify listeners */
   g_object_notify (G_OBJECT (item), "icon_name");
@@ -820,7 +831,6 @@
 void
 frap_menu_item_unref (FrapMenuItem *item)
 {
-  /* g_message ("g_object_unref (%s)", frap_menu_item_get_filename (item)); */
   g_object_unref (G_OBJECT (item));
 }
 

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to