[gimp] app: finally remove the get_active_item() and set_active_item() abstract…



commit bee4dd0fc382235da938f7ee00f2394739b72bae
Author: Jehan <jehan girinstud io>
Date:   Wed Oct 12 22:47:22 2022 +0200

    app: finally remove the get_active_item() and set_active_item() abstract…
    
    … methods of GimpItemTreeView.
    
    There were 2 last usages of get_active_item() which are now gone with this
    commit.

 app/widgets/gimpchanneltreeview.c  | 2 --
 app/widgets/gimpdrawabletreeview.c | 7 +++----
 app/widgets/gimpitemtreeview.c     | 4 +---
 app/widgets/gimpitemtreeview.h     | 2 --
 app/widgets/gimplayertreeview.c    | 2 --
 app/widgets/gimpvectorstreeview.c  | 2 --
 6 files changed, 4 insertions(+), 15 deletions(-)
---
diff --git a/app/widgets/gimpchanneltreeview.c b/app/widgets/gimpchanneltreeview.c
index 335c9681c7..f0b25422d7 100644
--- a/app/widgets/gimpchanneltreeview.c
+++ b/app/widgets/gimpchanneltreeview.c
@@ -108,8 +108,6 @@ gimp_channel_tree_view_class_init (GimpChannelTreeViewClass *klass)
   iv_class->signal_name      = "selected-channels-changed";
 
   iv_class->get_container    = gimp_image_get_channels;
-  iv_class->get_active_item  = (GimpGetItemFunc) gimp_image_get_active_channel;
-  iv_class->set_active_item  = (GimpSetItemFunc) gimp_image_set_active_channel;
   iv_class->get_selected_items = (GimpGetItemsFunc) gimp_image_get_selected_channels;
   iv_class->set_selected_items = (GimpSetItemsFunc) gimp_image_set_selected_channels;
   iv_class->add_item         = (GimpAddItemFunc) gimp_image_add_channel;
diff --git a/app/widgets/gimpdrawabletreeview.c b/app/widgets/gimpdrawabletreeview.c
index 84707cb33f..8f7eb20c75 100644
--- a/app/widgets/gimpdrawabletreeview.c
+++ b/app/widgets/gimpdrawabletreeview.c
@@ -331,16 +331,15 @@ static void
 gimp_drawable_tree_view_floating_selection_changed (GimpImage            *image,
                                                     GimpDrawableTreeView *view)
 {
-  GimpItem *item;
+  GList *items;
 
-  item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image);
+  items = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_selected_items (image);
 
   /*  update button states  */
   g_signal_handlers_block_by_func (gimp_item_tree_view_get_image (GIMP_ITEM_TREE_VIEW (view)),
                                    gimp_drawable_tree_view_floating_selection_changed,
                                    view);
-  gimp_container_view_select_item (GIMP_CONTAINER_VIEW (view),
-                                   (GimpViewable *) item);
+  gimp_container_view_select_items (GIMP_CONTAINER_VIEW (view), items);
   g_signal_handlers_unblock_by_func (gimp_item_tree_view_get_image (GIMP_ITEM_TREE_VIEW (view)),
                                      gimp_drawable_tree_view_floating_selection_changed,
                                      view);
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index 0d26f8bb18..ebc50c63d6 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -281,8 +281,6 @@ gimp_item_tree_view_class_init (GimpItemTreeViewClass *klass)
   klass->signal_name             = NULL;
 
   klass->get_container           = NULL;
-  klass->get_active_item         = NULL;
-  klass->set_active_item         = NULL;
   klass->get_selected_items      = NULL;
   klass->set_selected_items      = NULL;
   klass->add_item                = NULL;
@@ -813,7 +811,7 @@ gimp_item_tree_view_add_options (GimpItemTreeView *view,
       gtk_widget_show (view->priv->options_box);
 
       if (! view->priv->image ||
-          ! item_view_class->get_active_item (view->priv->image))
+          ! item_view_class->get_selected_items (view->priv->image))
         {
           gtk_widget_set_sensitive (view->priv->options_box, FALSE);
         }
diff --git a/app/widgets/gimpitemtreeview.h b/app/widgets/gimpitemtreeview.h
index cee2bd552d..aca9405be1 100644
--- a/app/widgets/gimpitemtreeview.h
+++ b/app/widgets/gimpitemtreeview.h
@@ -85,8 +85,6 @@ struct _GimpItemTreeViewClass
 
   /*  virtual functions for manipulating the image's item tree  */
   GimpGetContainerFunc  get_container;
-  GimpGetItemFunc       get_active_item;
-  GimpSetItemFunc       set_active_item;
   GimpGetItemsFunc      get_selected_items;
   GimpSetItemsFunc      set_selected_items;
   GimpAddItemFunc       add_item;
diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c
index d40a01aa7a..976d91293f 100644
--- a/app/widgets/gimplayertreeview.c
+++ b/app/widgets/gimplayertreeview.c
@@ -244,8 +244,6 @@ gimp_layer_tree_view_class_init (GimpLayerTreeViewClass *klass)
 
   item_view_class->set_image       = gimp_layer_tree_view_set_image;
   item_view_class->get_container   = gimp_image_get_layers;
-  item_view_class->get_active_item = (GimpGetItemFunc) gimp_image_get_active_layer;
-  item_view_class->set_active_item = (GimpSetItemFunc) gimp_image_set_active_layer;
   item_view_class->get_selected_items = (GimpGetItemsFunc) gimp_image_get_selected_layers;
   item_view_class->set_selected_items = (GimpSetItemsFunc) gimp_image_set_selected_layers;
   item_view_class->add_item        = (GimpAddItemFunc) gimp_image_add_layer;
diff --git a/app/widgets/gimpvectorstreeview.c b/app/widgets/gimpvectorstreeview.c
index e54948c660..1496a59e54 100644
--- a/app/widgets/gimpvectorstreeview.c
+++ b/app/widgets/gimpvectorstreeview.c
@@ -91,8 +91,6 @@ gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass)
   iv_class->signal_name     = "selected-vectors-changed";
 
   iv_class->get_container   = gimp_image_get_vectors;
-  iv_class->get_active_item = (GimpGetItemFunc) gimp_image_get_active_vectors;
-  iv_class->set_active_item = (GimpSetItemFunc) gimp_image_set_active_vectors;
   iv_class->get_selected_items = (GimpGetItemsFunc) gimp_image_get_selected_vectors;
   iv_class->set_selected_items = (GimpSetItemsFunc) gimp_image_set_selected_vectors;
   iv_class->add_item        = (GimpAddItemFunc) gimp_image_add_vectors;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]