static char *
get_drop_target_uri_at_pos (NautilusTreeViewDragDest *dest, int x, int y)
{
    char *drop_target = NULL;
    GtkTreePath *path;
    GtkTreePath *drop_path;
    GtkTreeViewDropPosition pos;

    gtk_tree_view_get_dest_row_at_pos (dest->details->tree_view, x, y,
                                       &path, &pos);
    if (pos == GTK_TREE_VIEW_DROP_BEFORE ||
            pos == GTK_TREE_VIEW_DROP_AFTER) {
        gtk_tree_path_free (path);
        path = NULL;
    }

    drop_path = get_drop_path (dest, path);

    drop_target = get_drop_target_uri_for_path (dest, drop_path);

    if (path != NULL) {
        gtk_tree_path_free (path);
    }

    if (drop_path != NULL) {
        gtk_tree_path_free (drop_path);
    }

    return drop_target;
}
static char *
get_drop_target_uri_at_pos (NemoTreeViewDragDest *dest, int x, int y)
{
	char *drop_target;
	GtkTreePath *path;
	GtkTreePath *drop_path;
	GtkTreeViewDropPosition pos;

	gtk_tree_view_get_dest_row_at_pos (dest->details->tree_view, x, y, 
					   &path, &pos);

	drop_path = get_drop_path (dest, path);

	drop_target = get_drop_target_uri_for_path (dest, drop_path);

	if (path != NULL) {
		gtk_tree_path_free (path);
	}

	if (drop_path != NULL) {
		gtk_tree_path_free (drop_path);
	}

	return drop_target;
}
static guint
get_drop_action (NautilusTreeViewDragDest *dest,
                 GdkDragContext *context,
                 GtkTreePath *path)
{
    char *drop_target;
    int action;

    if (!dest->details->have_drag_data ||
            (dest->details->drag_type == NAUTILUS_ICON_DND_GNOME_ICON_LIST &&
             dest->details->drag_list == NULL)) {
        return 0;
    }

    drop_target = get_drop_target_uri_for_path (dest, path);
    if (drop_target == NULL) {
        return 0;
    }

    action = 0;
    switch (dest->details->drag_type) {
    case NAUTILUS_ICON_DND_GNOME_ICON_LIST :
        nautilus_drag_default_drop_action_for_icons
        (context,
         drop_target,
         dest->details->drag_list,
         &action);
        break;
    case NAUTILUS_ICON_DND_NETSCAPE_URL:
        action = nautilus_drag_default_drop_action_for_netscape_url (context);
        break;
    case NAUTILUS_ICON_DND_URI_LIST :
        action = gdk_drag_context_get_suggested_action (context);
        break;
    case NAUTILUS_ICON_DND_TEXT:
    case NAUTILUS_ICON_DND_RAW:
    case NAUTILUS_ICON_DND_XDNDDIRECTSAVE:
        action = GDK_ACTION_COPY;
        break;
    }

    g_free (drop_target);

    return action;
}
static void
check_hover_expand_timer (NautilusTreeViewDragDest *dest,
                          GtkTreePath *path,
                          GtkTreePath *drop_path,
                          GtkTreePath *old_drop_path)
{
    gboolean use_tree = g_settings_get_boolean (nautilus_list_view_preferences,
                        NAUTILUS_PREFERENCES_LIST_VIEW_USE_TREE);

    if (use_tree) {
        check_expand_timer (dest, drop_path, old_drop_path);
    } else {
        char *uri;
        uri = get_drop_target_uri_for_path (dest, path);
        check_hover_timer (dest, uri);
        g_free (uri);
    }
}