GBookmarkFile: Streamline error handling a bit

This commit is contained in:
Matthias Clasen 2013-12-31 12:45:09 -05:00
parent 228a2c82f6
commit 14359e17c9

View File

@ -3527,7 +3527,6 @@ g_bookmark_file_move_item (GBookmarkFile *bookmark,
GError **error) GError **error)
{ {
BookmarkItem *item; BookmarkItem *item;
GError *remove_error;
g_return_val_if_fail (bookmark != NULL, FALSE); g_return_val_if_fail (bookmark != NULL, FALSE);
g_return_val_if_fail (old_uri != 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)) if (g_bookmark_file_has_item (bookmark, new_uri))
{ {
remove_error = NULL; if (!g_bookmark_file_remove_item (bookmark, new_uri, error))
g_bookmark_file_remove_item (bookmark, new_uri, &remove_error); return FALSE;
if (remove_error)
{
g_propagate_error (error, remove_error);
return FALSE;
}
} }
g_hash_table_steal (bookmark->items_by_uri, item->uri); g_hash_table_steal (bookmark->items_by_uri, item->uri);
@ -3568,14 +3561,8 @@ g_bookmark_file_move_item (GBookmarkFile *bookmark,
} }
else else
{ {
remove_error = NULL; if (!g_bookmark_file_remove_item (bookmark, old_uri, error))
g_bookmark_file_remove_item (bookmark, old_uri, &remove_error); return FALSE;
if (remove_error)
{
g_propagate_error (error, remove_error);
return FALSE;
}
return TRUE; return TRUE;
} }