summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdocument/ev-mapping-list.c19
-rw-r--r--libdocument/ev-mapping-list.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/libdocument/ev-mapping-list.c b/libdocument/ev-mapping-list.c
index 8c639e8e..6745d1d9 100644
--- a/libdocument/ev-mapping-list.c
+++ b/libdocument/ev-mapping-list.c
@@ -156,6 +156,25 @@ ev_mapping_list_get_list (EvMappingList *mapping_list)
return mapping_list ? mapping_list->list : NULL;
}
+/**
+ * ev_mapping_list_remove:
+ * @mapping_list: an #EvMappingList
+ * @mapping: #EvMapping to remove
+ *
+ * Returns: an #EvMappingList
+ *
+ * Since: 3.14
+ */
+EvMappingList *
+ev_mapping_list_remove (EvMappingList *mapping_list,
+ EvMapping *mapping)
+{
+ mapping_list->list = g_list_remove (mapping_list->list, mapping);
+ mapping_list->data_destroy_func (mapping->data);
+ g_free (mapping);
+ return mapping_list;
+}
+
guint
ev_mapping_list_get_page (EvMappingList *mapping_list)
{
diff --git a/libdocument/ev-mapping-list.h b/libdocument/ev-mapping-list.h
index e4cb5a80..bb9494fa 100644
--- a/libdocument/ev-mapping-list.h
+++ b/libdocument/ev-mapping-list.h
@@ -42,6 +42,8 @@ void ev_mapping_list_unref (EvMappingList *mapping_list);
guint ev_mapping_list_get_page (EvMappingList *mapping_list);
GList *ev_mapping_list_get_list (EvMappingList *mapping_list);
+EvMappingList *ev_mapping_list_remove (EvMappingList *mapping_list,
+ EvMapping *mapping);
EvMapping *ev_mapping_list_find (EvMappingList *mapping_list,
gconstpointer data);
EvMapping *ev_mapping_list_find_custom (EvMappingList *mapping_list,