]> spindle.queued.net Git - midori/commitdiff
Allow DND also for cookie items by using the value of the parent node
authorEnrico Tröger <enrico.troeger@uvena.de>
Thu, 7 Jan 2010 23:13:29 +0000 (00:13 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 7 Jan 2010 23:16:56 +0000 (00:16 +0100)
extensions/cookie-manager/cookie-manager-page.c

index 5aa9dbcc6ce8828f0e4a00e6a66288958105ba56..1cc2be2a19604453c70845d7798f07a94726d1e6 100644 (file)
@@ -568,10 +568,17 @@ static void cm_tree_drag_data_get_cb(GtkWidget *widget, GdkDragContext *drag_con
                        COOKIE_MANAGER_COL_COOKIE, &cookie,
                        -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);
                }
                g_free(name);