Commit 29d16f4b authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte
Browse files

GladeProject: cleanup glade_project_command_paste()

parent ccd09e9d
...@@ -5318,8 +5318,7 @@ glade_project_command_paste (GladeProject *project, ...@@ -5318,8 +5318,7 @@ glade_project_command_paste (GladeProject *project,
{ {
GladeClipboard *clipboard; GladeClipboard *clipboard;
GList *list; GList *list;
GladeWidget *widget = NULL, *parent; GladeWidget *widget = NULL, *parent = NULL;
gint placeholder_relations = 0;
g_return_if_fail (GLADE_IS_PROJECT (project)); g_return_if_fail (GLADE_IS_PROJECT (project));
...@@ -5339,8 +5338,10 @@ glade_project_command_paste (GladeProject *project, ...@@ -5339,8 +5338,10 @@ glade_project_command_paste (GladeProject *project,
/* If there is a selection, paste in to the selected widget, otherwise /* If there is a selection, paste in to the selected widget, otherwise
* paste into the placeholder's parent, or at the toplevel * paste into the placeholder's parent, or at the toplevel
*/ */
parent = list ? glade_widget_get_from_gobject (list->data) : if (list)
(placeholder) ? glade_placeholder_get_parent (placeholder) : NULL; 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; widget = glade_clipboard_widgets (clipboard) ? glade_clipboard_widgets (clipboard)->data : NULL;
...@@ -5393,21 +5394,6 @@ glade_project_command_paste (GladeProject *project, ...@@ -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); glade_command_paste (glade_clipboard_widgets (clipboard), parent, placeholder, project);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment