diff options
author | Emmanuele Bassi <ebassi@cvs.gnome.org> | 2006-06-12 17:19:13 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@src.gnome.org> | 2006-06-12 17:19:13 +0000 |
commit | cc37f43d1d635fa2494f35f17159199ea88d31d2 (patch) | |
tree | 72f5c016a19767389c8eaacfd62dfd1082e44944 /glib/gbookmarkfile.c | |
parent | e39b7933419f6728af65be892e5adc703686c9fc (diff) | |
download | glib-cc37f43d1d635fa2494f35f17159199ea88d31d2.tar.gz |
Return a boolean instead of void.
2006-06-12 Emmanuele Bassi <ebassi@cvs.gnome.org>
* glib/gbookmarkfile.h:
* glib/gbookmarkfile.c (g_bookmark_file_remove_item): Return
a boolean instead of void.
* tests/bookmarkfile-test.c (test_modify): Add a test case
for g_bookmark_file_remove_item().
Diffstat (limited to 'glib/gbookmarkfile.c')
-rw-r--r-- | glib/gbookmarkfile.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c index 889937f2b..34ddb9f96 100644 --- a/glib/gbookmarkfile.c +++ b/glib/gbookmarkfile.c @@ -2016,17 +2016,19 @@ g_bookmark_file_add_item (GBookmarkFile *bookmark, * * Removes the bookmark for @uri from the bookmark file @bookmark. * + * Return value: %TRUE if the bookmark was removed successfully. + * * Since: 2.12 */ -void +gboolean g_bookmark_file_remove_item (GBookmarkFile *bookmark, const gchar *uri, GError **error) { BookmarkItem *item; - g_return_if_fail (bookmark != NULL); - g_return_if_fail (uri != NULL); + g_return_val_if_fail (bookmark != NULL, FALSE); + g_return_val_if_fail (uri != NULL, FALSE); item = g_bookmark_file_lookup_item (bookmark, uri); @@ -2036,13 +2038,15 @@ g_bookmark_file_remove_item (GBookmarkFile *bookmark, G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND, _("No bookmark found for URI '%s'"), uri); - return; + return FALSE; } bookmark->items = g_list_remove (bookmark->items, item); g_hash_table_remove (bookmark->items_by_uri, item->uri); bookmark_item_free (item); + + return TRUE; } /** |