[gtk/rubberband-again] Drop gtk_multi_selection-copy
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/rubberband-again] Drop gtk_multi_selection-copy
- Date: Fri, 5 Jun 2020 04:22:11 +0000 (UTC)
commit 7dfeeccf451945a874dddddea87ec7d4332035ca
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jun 5 00:15:09 2020 -0400
Drop gtk_multi_selection-copy
It is not used anymore.
gtk/gtkmultiselection.c | 48 ------------------------------------------------
gtk/gtkmultiselection.h | 2 --
2 files changed, 50 deletions(-)
---
diff --git a/gtk/gtkmultiselection.c b/gtk/gtkmultiselection.c
index a0ffb92fee..00d02998d5 100644
--- a/gtk/gtkmultiselection.c
+++ b/gtk/gtkmultiselection.c
@@ -387,51 +387,3 @@ gtk_multi_selection_new (GListModel *model)
"model", model,
NULL);
}
-
-/**
- * gtk_multi_selection_copy:
- * @selection: the #GtkSelectionModel to copy
- *
- * Creates a #GtkMultiSelection that has the same underlying
- * model and the same selected items as @selection.
- *
- * Returns: (transfer full): a new #GtkMultiSelection
- */
-GtkMultiSelection *
-gtk_multi_selection_copy (GtkSelectionModel *selection)
-{
- GtkMultiSelection *copy;
- GListModel *model;
-
- g_object_get (selection, "model", &model, NULL);
-
- copy = GTK_MULTI_SELECTION (gtk_multi_selection_new (model));
-
- if (GTK_IS_MULTI_SELECTION (selection))
- {
- GtkMultiSelection *multi = GTK_MULTI_SELECTION (selection);
-
- gtk_set_free (copy->selected);
- copy->selected = gtk_set_copy (multi->selected);
- copy->last_selected = multi->last_selected;
- }
- else
- {
- guint pos, n;
- guint start, n_items;
- gboolean selected;
-
- n = g_list_model_get_n_items (model);
- n_items = 0;
- for (pos = 0; pos < n; pos += n_items)
- {
- gtk_selection_model_query_range (selection, pos, &start, &n_items, &selected);
- if (selected)
- gtk_selection_model_select_range (GTK_SELECTION_MODEL (copy), start, n_items, FALSE);
- }
- }
-
- g_object_unref (model);
-
- return copy;
-}
diff --git a/gtk/gtkmultiselection.h b/gtk/gtkmultiselection.h
index e4147c2a66..2045e858ed 100644
--- a/gtk/gtkmultiselection.h
+++ b/gtk/gtkmultiselection.h
@@ -33,8 +33,6 @@ G_DECLARE_FINAL_TYPE (GtkMultiSelection, gtk_multi_selection, GTK, MULTI_SELECTI
GDK_AVAILABLE_IN_ALL
GListModel * gtk_multi_selection_new (GListModel *model);
-GDK_AVAILABLE_IN_ALL
-GtkMultiSelection * gtk_multi_selection_copy (GtkSelectionModel *selection);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]