[glade] GladeProject: cleanup glade_project_command_paste()



commit 29d16f4b29ed050834c76a8b8a6a5c0fd9dff090
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Fri Sep 25 16:27:15 2020 -0300

    GladeProject: cleanup glade_project_command_paste()

 gladeui/glade-project.c | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)
---
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index aa48aee9..66afb895 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -5318,8 +5318,7 @@ glade_project_command_paste (GladeProject     *project,
 {
   GladeClipboard *clipboard;
   GList *list;
-  GladeWidget *widget = NULL, *parent;
-  gint placeholder_relations = 0;
+  GladeWidget *widget = NULL, *parent = NULL;
 
   g_return_if_fail (GLADE_IS_PROJECT (project));
 
@@ -5339,8 +5338,10 @@ glade_project_command_paste (GladeProject     *project,
   /* If there is a selection, paste in to the selected widget, otherwise
    * paste into the placeholder's parent, or at the toplevel
    */
-  parent = list ? glade_widget_get_from_gobject (list->data) :
-      (placeholder) ? glade_placeholder_get_parent (placeholder) : NULL;
+  if (list)
+    parent = glade_widget_get_from_gobject (list->data);
+  else if (placeholder)
+    parent = glade_placeholder_get_parent (placeholder);
 
   widget = glade_clipboard_widgets (clipboard) ? glade_clipboard_widgets (clipboard)->data : NULL;
 
@@ -5393,21 +5394,6 @@ glade_project_command_paste (GladeProject     *project,
         }
     }
 
-
-  /* Check that we have compatible heirarchies */
-  for (list = glade_clipboard_widgets (clipboard); list && list->data; list = list->next)
-    {
-      widget = list->data;
-
-      if (!GLADE_WIDGET_ADAPTOR_IS_TOPLEVEL (glade_widget_get_adaptor (widget)) && parent)
-        {
-          /* Count placeholder relations
-           */
-          if (glade_widget_placeholder_relation (parent, widget))
-            placeholder_relations++;
-        }
-    }
-
   glade_command_paste (glade_clipboard_widgets (clipboard), parent, placeholder, project);
 }
 


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