From 29d16f4b29ed050834c76a8b8a6a5c0fd9dff090 Mon Sep 17 00:00:00 2001 From: Juan Pablo Ugarte Date: Fri, 25 Sep 2020 16:27:15 -0300 Subject: GladeProject: cleanup glade_project_command_paste() --- gladeui/glade-project.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'gladeui') 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); } -- cgit v1.2.1