From 62c5a79e2bf97b73d3a15263a138bb5d6711735c Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 1 Mar 2000 11:25:25 +0000 Subject: [PATCH] r201: Allowed dragging to a subdirectory to save into it. --- ROX-Filer/src/dnd.c | 23 ++++++++++++++++++----- ROX-Filer/src/main.c | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ROX-Filer/src/dnd.c b/ROX-Filer/src/dnd.c index 5c6c333e..d1d76726 100644 --- a/ROX-Filer/src/dnd.c +++ b/ROX-Filer/src/dnd.c @@ -488,8 +488,16 @@ static gboolean drag_motion(GtkWidget *widget, ? (DirItem *) filer_window->collection->items[item_number].data : NULL; - if (item && !(item->flags & (ITEM_FLAG_APPDIR | ITEM_FLAG_EXEC_FILE))) - item = NULL; /* Drop onto non-executable == no item */ + if (item) + { + /* If we didn't drop onto a directory, application or + * executable file then act as though the drop is to the + * window background. + */ + if (item->base_type != TYPE_DIRECTORY + && !(item->flags & ITEM_FLAG_EXEC_FILE)) + item = NULL; + } if (!item) { @@ -519,10 +527,11 @@ static gboolean drag_motion(GtkWidget *widget, } else { - /* Drop onto a program of some sort */ + /* Drop onto a program/directory of some sort */ if (!(provides(context, text_uri_list) || provides(context, application_octet_stream))) goto out; + /* (actually, we should probably allow any data type) */ if (gtk_drag_get_source_widget(context) == widget) { @@ -532,8 +541,12 @@ static gboolean drag_motion(GtkWidget *widget, goto out; } - /* Actually, we should probably allow any data type */ - type = drop_dest_prog; + if (item->base_type == TYPE_DIRECTORY && + !(item->flags & ITEM_FLAG_APPDIR)) + type = drop_dest_dir; + else + type = drop_dest_prog; + new_path = make_path(filer_window->path, item->leafname)->str; collection_set_cursor_item(filer_window->collection, diff --git a/ROX-Filer/src/main.c b/ROX-Filer/src/main.c index ead26c2b..e688a46e 100644 --- a/ROX-Filer/src/main.c +++ b/ROX-Filer/src/main.c @@ -59,7 +59,7 @@ gid_t egid; int ngroups; /* Number of supplemental groups */ gid_t *supplemental_groups = NULL; -#define VERSION "ROX-Filer 0.1.15\n" \ +#define VERSION "ROX-Filer 0.1.16\n" \ "Copyright (C) 1999 Thomas Leonard.\n" \ "ROX-Filer comes with ABSOLUTELY NO WARRANTY,\n" \ "to the extent permitted by law.\n" \ -- 2.11.4.GIT