[gimp] Bug 611514 - Layers inside layer groups can't be dragged to layer dock buttons



commit 842f1df2f222753ae589eabf7529712167bfd580
Author: Michael Natterer <mitch gimp org>
Date:   Tue Mar 2 17:54:29 2010 +0100

    Bug 611514 - Layers inside layer groups can't be dragged to layer dock buttons
    
    In the drop callbacks, don't check if the GimpContainerView's container
    contains the dropped item, it might be in a sub-container. Instead,
    simply checking if the GimpContainerView knows the item is sufficient
    (and also much simpler than a recursive container serach).

 app/widgets/gimpcontainerview.c |    6 ++----
 app/widgets/gimpitemtreeview.c  |    9 +++------
 2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/app/widgets/gimpcontainerview.c b/app/widgets/gimpcontainerview.c
index 4e087f4..41a24e6 100644
--- a/app/widgets/gimpcontainerview.c
+++ b/app/widgets/gimpcontainerview.c
@@ -1185,11 +1185,9 @@ gimp_container_view_button_viewable_dropped (GtkWidget    *widget,
                                              GimpViewable *viewable,
                                              gpointer      data)
 {
-  GimpContainerView        *view    = GIMP_CONTAINER_VIEW (data);
-  GimpContainerViewPrivate *private = GIMP_CONTAINER_VIEW_GET_PRIVATE (view);
+  GimpContainerView *view = GIMP_CONTAINER_VIEW (data);
 
-  if (viewable && private->container &&
-      gimp_container_have (private->container, GIMP_OBJECT (viewable)))
+  if (viewable && gimp_container_view_lookup (view, viewable))
     {
       gimp_container_view_item_selected (view, viewable);
 
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index c470e62..b78bc75 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -1134,13 +1134,10 @@ gimp_item_tree_view_new_dropped (GtkWidget    *widget,
                                  gpointer      data)
 {
   GimpItemTreeViewClass *item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (data);
-  GimpItemTreeView      *view            = GIMP_ITEM_TREE_VIEW (data);
-  GimpContainer         *container;
+  GimpContainerView     *view            = GIMP_CONTAINER_VIEW (data);
 
-  container = gimp_container_view_get_container (GIMP_CONTAINER_VIEW (view));
-
-  if (viewable && gimp_container_have (container, GIMP_OBJECT (viewable)) &&
-      item_view_class->new_default_action)
+  if (item_view_class->new_default_action &&
+      viewable && gimp_container_view_lookup (view, viewable))
     {
       GtkAction *action;
 



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