[glib] GBookmarkFile: Streamline error handling a bit



commit 14359e17c99fdcd9f7492aad0b4795e18795e540
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 31 12:45:09 2013 -0500

    GBookmarkFile: Streamline error handling a bit

 glib/gbookmarkfile.c |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c
index 3c6d597..d244917 100644
--- a/glib/gbookmarkfile.c
+++ b/glib/gbookmarkfile.c
@@ -3527,7 +3527,6 @@ g_bookmark_file_move_item (GBookmarkFile  *bookmark,
                           GError        **error)
 {
   BookmarkItem *item;
-  GError *remove_error;
   
   g_return_val_if_fail (bookmark != NULL, FALSE);
   g_return_val_if_fail (old_uri != NULL, FALSE);
@@ -3546,14 +3545,8 @@ g_bookmark_file_move_item (GBookmarkFile  *bookmark,
     {
       if (g_bookmark_file_has_item (bookmark, new_uri))
         {
-          remove_error = NULL;
-          g_bookmark_file_remove_item (bookmark, new_uri, &remove_error);
-          if (remove_error)
-            {
-              g_propagate_error (error, remove_error);
-              
-              return FALSE;
-            }
+          if (!g_bookmark_file_remove_item (bookmark, new_uri, error))
+            return FALSE;
         }
 
       g_hash_table_steal (bookmark->items_by_uri, item->uri);
@@ -3568,14 +3561,8 @@ g_bookmark_file_move_item (GBookmarkFile  *bookmark,
     }
   else
     {
-      remove_error = NULL;
-      g_bookmark_file_remove_item (bookmark, old_uri, &remove_error);
-      if (remove_error)
-        {
-          g_propagate_error (error, remove_error);
-          
-          return FALSE;
-        }
+      if (!g_bookmark_file_remove_item (bookmark, old_uri, error))
+        return FALSE;
 
       return TRUE;
     }


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