Commit 130f9695 authored by John Sullivan's avatar John Sullivan

Added nautilus_bookmark_copy and fixed g_return_if_fail compile problem.

parent 10cb529f
1999-12-28 John Sullivan <sullivan@eazel.com>
* src/nautilus-bookmarklist.c:
(nautilus_bookmarklist_contains):
changed two g_return_if_fail to g_return_val_if_fail. Eek! I
accidentally checked this in yesterday without compiling. I
should be tarred and feathered.
(nautilus_bookmarklist_append): Now calls new nautilus_bookmark_copy
* src/nautilus-bookmark.[ch]:
(nautilus_bookmark_copy): New method
1999-12-28 John Sullivan <sullivan@eazel.com>
* src/nautilus-bookmark.c:
......
......@@ -141,6 +141,16 @@ nautilus_bookmark_compare_with (gconstpointer a, gconstpointer b)
return 0;
}
NautilusBookmark *
nautilus_bookmark_copy (const NautilusBookmark *bookmark)
{
g_return_val_if_fail(NAUTILUS_IS_BOOKMARK (bookmark), NULL);
return nautilus_bookmark_new(
nautilus_bookmark_get_name(bookmark),
nautilus_bookmark_get_uri(bookmark));
}
const gchar *
nautilus_bookmark_get_name (const NautilusBookmark *bookmark)
{
......
......@@ -56,6 +56,7 @@ typedef struct _NautilusBookmarkClass NautilusBookmarkClass;
GtkType nautilus_bookmark_get_type (void);
NautilusBookmark *nautilus_bookmark_new (const gchar *name,
const gchar *uri);
NautilusBookmark *nautilus_bookmark_copy (const NautilusBookmark *);
const gchar *nautilus_bookmark_get_name (const NautilusBookmark *);
const gchar *nautilus_bookmark_get_uri (const NautilusBookmark *);
......
......@@ -118,16 +118,11 @@ void
nautilus_bookmarklist_append (NautilusBookmarklist *bookmarks,
const NautilusBookmark *bookmark)
{
NautilusBookmark *new_bookmark;
g_return_if_fail (NAUTILUS_IS_BOOKMARKLIST (bookmarks));
g_return_if_fail (NAUTILUS_IS_BOOKMARK (bookmark));
new_bookmark = nautilus_bookmark_new(
nautilus_bookmark_get_name(bookmark),
nautilus_bookmark_get_uri(bookmark));
bookmarks->list = g_list_append(bookmarks->list, new_bookmark);
bookmarks->list = g_list_append(bookmarks->list,
nautilus_bookmark_copy(bookmark));
nautilus_bookmarklist_contents_changed(bookmarks);
}
......@@ -144,8 +139,8 @@ gboolean
nautilus_bookmarklist_contains (NautilusBookmarklist *bookmarks,
const NautilusBookmark *bookmark)
{
g_return_if_fail (NAUTILUS_IS_BOOKMARKLIST (bookmarks));
g_return_if_fail (NAUTILUS_IS_BOOKMARK (bookmark));
g_return_val_if_fail (NAUTILUS_IS_BOOKMARKLIST (bookmarks), FALSE);
g_return_val_if_fail (NAUTILUS_IS_BOOKMARK (bookmark), FALSE);
return g_list_find_custom(bookmarks->list,
(gpointer)bookmark,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment