58 if (a->page < b->page)
60 if (a->page > b->page)
80 if (bookmarks->
items) {
82 bookmarks->
items = NULL;
86 g_object_unref (bookmarks->
metadata);
90 G_OBJECT_CLASS (ev_bookmarks_parent_class)->finalize (
object);
111 G_OBJECT_WARN_INVALID_PROPERTY_ID (
object, prop_id, pspec);
123 GError *error = NULL;
128 if (!bm_list_str || bm_list_str[0] ==
'\0')
131 bm_list = g_variant_parse ((
const GVariantType *)
"a(us)",
132 bm_list_str, NULL, NULL,
135 g_warning (
"Error getting bookmarks: %s\n", error->message);
136 g_error_free (error);
141 g_variant_iter_init (&iter, bm_list);
142 while ((child = g_variant_iter_next_value (&iter))) {
145 g_variant_get (child,
"(us)", &bm->
page, &bm->
title);
147 bookmarks->
items = g_list_prepend (bookmarks->
items, bm);
148 g_variant_unref (child);
150 g_variant_unref (bm_list);
152 bookmarks->
items = g_list_reverse (bookmarks->
items);
158 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
164 g_object_class_install_property (gobject_class,
166 g_param_spec_object (
"metadata",
168 "The document metadata",
170 G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE |
171 G_PARAM_STATIC_STRINGS));
174 g_signal_new (
"changed",
179 g_cclosure_marshal_VOID__VOID,
189 "metadata", metadata, NULL));
196 GVariantBuilder builder;
200 if (!bookmarks->
items) {
205 g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
206 for (l = bookmarks->
items; l; l = g_list_next (l)) {
209 g_variant_builder_add (&builder,
"(u&s)", bm->
page, bm->
title);
211 bm_list = g_variant_builder_end (&builder);
213 bm_list_str = g_variant_print (bm_list,
FALSE);
214 g_variant_unref (bm_list);
216 g_free (bm_list_str);
224 return g_list_copy (bookmarks->
items);
232 return bookmarks->
items != NULL;
242 g_return_if_fail (bookmark->
title != NULL);
249 bookmarks->
items = g_list_append (bookmarks->
items, bm);
266 bookmarks->
items = g_list_delete_link (bookmarks->
items, bm_link);
279 g_return_if_fail (bookmark->
title != NULL);