summaryrefslogtreecommitdiff
path: root/gladeui
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-09-25 16:27:15 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-09-25 16:31:27 -0300
commit29d16f4b29ed050834c76a8b8a6a5c0fd9dff090 (patch)
tree41d3dfe4cd566bb63c85bca3e261defcdbab52ce /gladeui
parentccd09e9d86a52af5f720b2e79bd4f2ca7a1f1ddd (diff)
downloadglade-29d16f4b29ed050834c76a8b8a6a5c0fd9dff090.tar.gz
GladeProject: cleanup glade_project_command_paste()
Diffstat (limited to 'gladeui')
-rw-r--r--gladeui/glade-project.c24
1 files 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);
}