[Xfce4-commits] <garcon:master> Use the return value of g_key_file_load_from_file, not the error.

Nick Schermer nick at xfce.org
Sun Aug 16 18:06:07 CEST 2009


Updating branch refs/heads/master
         to 3e471653350e674c1910bd2826a0dd1c331a8894 (commit)
       from 7c0663052cf2f48a5fef5b63339a7e538fb19bb1 (commit)

commit 3e471653350e674c1910bd2826a0dd1c331a8894
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Aug 16 13:14:59 2009 +0200

    Use the return value of g_key_file_load_from_file, not the error.

 garcon/garcon-menu-item.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/garcon/garcon-menu-item.c b/garcon/garcon-menu-item.c
index 55d24e3..b5aa2e9 100644
--- a/garcon/garcon-menu-item.c
+++ b/garcon/garcon-menu-item.c
@@ -531,7 +531,6 @@ garcon_menu_item_new (const gchar *uri)
 {
   GarconMenuItem *item = NULL;
   GKeyFile       *rc = NULL;
-  GError         *error = NULL;
   GFile          *file;
   GList          *categories = NULL;
   gboolean        terminal;
@@ -560,12 +559,8 @@ garcon_menu_item_new (const gchar *uri)
 
   /* Try to open the .desktop file */
   rc = g_key_file_new ();
-  g_key_file_load_from_file (rc, filename, G_KEY_FILE_NONE, &error);
-  if (G_UNLIKELY (error != NULL))
-    {
-      g_error_free (error);
-      goto error;
-    }
+  if (!g_key_file_load_from_file (rc, filename, G_KEY_FILE_NONE, NULL))
+    goto error;
 
   /* Abort if the file has been marked as "deleted"/hidden */
   if (G_UNLIKELY (g_key_file_get_boolean (rc, "Desktop Entry", "Hidden", NULL)))



More information about the Xfce4-commits mailing list