static GtkTreePath * get_drop_path (NautilusTreeViewDragDest *dest, GtkTreePath *path) { NautilusFile *file; GtkTreePath *ret; if (!path || !dest->details->have_drag_data) { return NULL; } ret = gtk_tree_path_copy (path); file = file_for_path (dest, ret); /* Go up the tree until we find a file that can accept a drop */ while (file == NULL /* dummy row */ || !nautilus_drag_can_accept_info (file, dest->details->drag_type, dest->details->drag_list)) { if (gtk_tree_path_get_depth (ret) == 1) { gtk_tree_path_free (ret); ret = NULL; break; } else { gtk_tree_path_up (ret); nautilus_file_unref (file); file = file_for_path (dest, ret); } } nautilus_file_unref (file); return ret; }
static char * get_drop_target_uri_for_path (NemoTreeViewDragDest *dest, GtkTreePath *path) { NemoFile *file; char *target; file = file_for_path (dest, path); if (file == NULL) { return NULL; } target = nemo_file_get_drop_target_uri (file); nemo_file_unref (file); return target; }
static char * get_drop_target_uri_for_path (NautilusTreeViewDragDest *dest, GtkTreePath *path) { NautilusFile *file; char *target = NULL; gboolean can; file = file_for_path (dest, path); if (file == NULL) { return NULL; } can = nautilus_drag_can_accept_info (file, dest->details->drag_type, dest->details->drag_list); if (can) { target = nautilus_file_get_drop_target_uri (file); } nautilus_file_unref (file); return target; }