Allow DND also for cookie items by using the value of the parent node

This commit is contained in:
Enrico Tröger 2010-01-08 00:13:29 +01:00 committed by Christian Dywan
parent e67d87247a
commit ca73b5fede

View file

@ -568,10 +568,17 @@ static void cm_tree_drag_data_get_cb(GtkWidget *widget, GdkDragContext *drag_con
COOKIE_MANAGER_COL_COOKIE, &cookie, COOKIE_MANAGER_COL_COOKIE, &cookie,
-1); -1);
if (cookie == NULL && name != NULL) if (name != NULL)
{ {
text = cm_skip_leading_dot(name); GtkTreeIter parent;
/* get the name of the parent item which should be a domain item */
if (cookie != NULL && gtk_tree_model_iter_parent(model, &parent, &iter))
{
g_free(name);
gtk_tree_model_get(model, &parent, COOKIE_MANAGER_COL_NAME, &name, -1);
}
text = cm_skip_leading_dot(name);
gtk_selection_data_set_text(data, text, -1); gtk_selection_data_set_text(data, text, -1);
} }
g_free(name); g_free(name);