4 * ROX-Filer, filer for the ROX desktop project
5 * Copyright (C) 1999, Thomas Leonard, <tal197@ecs.soton.ac.uk>.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 * Place, Suite 330, Boston, MA 02111-1307 USA
22 /* dnd.c - code for handling drag and drop */
33 #include <X11/Xatom.h>
35 #include "collection.h"
40 #include "gui_support.h"
44 #define MAXURILEN 4096 /* Longest URI to allow */
46 /* Static prototypes */
47 static char *get_dest_path(FilerWindow
*filer_window
, GdkDragContext
*context
);
48 static void create_uri_list(GString
*string
,
49 Collection
*collection
,
50 FilerWindow
*filer_window
);
51 static gboolean
drag_drop(GtkWidget
*widget
,
52 GdkDragContext
*context
,
56 static gboolean
provides(GdkDragContext
*context
, GdkAtom target
);
57 static void set_xds_prop(GdkDragContext
*context
, char *text
);
58 static gboolean
drag_motion(GtkWidget
*widget
,
59 GdkDragContext
*context
,
63 static void drag_leave(GtkWidget
*widget
,
64 GdkDragContext
*context
);
65 static void drag_data_received(GtkWidget
*widget
,
66 GdkDragContext
*context
,
69 GtkSelectionData
*selection_data
,
72 static void got_data_xds_reply(GtkWidget
*widget
,
73 GdkDragContext
*context
,
74 GtkSelectionData
*selection_data
,
76 static void got_data_raw(GtkWidget
*widget
,
77 GdkDragContext
*context
,
78 GtkSelectionData
*selection_data
,
80 static GSList
*uri_list_to_gslist(char *uri_list
);
81 static void got_uri_list(GtkWidget
*widget
,
82 GdkDragContext
*context
,
83 GtkSelectionData
*selection_data
,
85 static char *get_local_path(char *uri
);
86 static void run_with_files(char *path
, GSList
*uri_list
);
87 static GtkWidget
*create_options();
88 static void update_options();
89 static void set_options();
90 static void save_options();
91 static char *load_no_hostnames(char *data
);
93 /* Possible values for drop_dest_type (can also be NULL).
94 * In either case, drop_dest_path is the app/file/dir to use.
96 static char *drop_dest_prog
= "drop_dest_prog"; /* Run a program */
97 static char *drop_dest_dir
= "drop_dest_dir"; /* Save to path */
99 static OptionsSection options
=
101 "Drag and Drop options",
115 GdkAtom XdndDirectSave0
;
116 GdkAtom xa_text_plain
;
117 GdkAtom text_uri_list
;
118 GdkAtom application_octet_stream
;
122 XdndDirectSave0
= gdk_atom_intern("XdndDirectSave0", FALSE
);
123 xa_text_plain
= gdk_atom_intern("text/plain", FALSE
);
124 text_uri_list
= gdk_atom_intern("text/uri-list", FALSE
);
125 application_octet_stream
= gdk_atom_intern("application/octet-stream",
128 options_sections
= g_slist_prepend(options_sections
, &options
);
129 option_register("dnd_no_hostnames", load_no_hostnames
);
134 static gboolean o_no_hostnames
= FALSE
;
135 static GtkWidget
*toggle_no_hostnames
;
137 /* Build up some option widgets to go in the options dialog, but don't
140 static GtkWidget
*create_options()
142 GtkWidget
*vbox
, *label
;
144 vbox
= gtk_vbox_new(FALSE
, 0);
145 gtk_container_set_border_width(GTK_CONTAINER(vbox
), 4);
147 label
= gtk_label_new("Some older applications don't support XDND "
148 "fully and may need to have this option turned on. "
149 "Use this if dragging files to an application shows "
150 "a + sign on the pointer but the drop doesn't work.");
151 gtk_label_set_line_wrap(GTK_LABEL(label
), TRUE
);
152 gtk_box_pack_start(GTK_BOX(vbox
), label
, FALSE
, TRUE
, 0);
154 toggle_no_hostnames
=
155 gtk_check_button_new_with_label("Don't use hostnames");
156 gtk_box_pack_start(GTK_BOX(vbox
), toggle_no_hostnames
, FALSE
, TRUE
, 0);
161 static void update_options()
163 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_no_hostnames
),
167 static void set_options()
169 o_no_hostnames
= gtk_toggle_button_get_active(
170 GTK_TOGGLE_BUTTON(toggle_no_hostnames
));
173 static void save_options()
175 option_write("dnd_no_hostnames", o_no_hostnames
? "1" : "0");
178 static char *load_no_hostnames(char *data
)
180 o_no_hostnames
= atoi(data
) != 0;
184 /* SUPPORT FUNCTIONS */
186 static char *get_dest_path(FilerWindow
*filer_window
, GdkDragContext
*context
)
190 path
= g_dataset_get_data(context
, "drop_dest_path");
192 return path
? path
: filer_window
->path
;
195 /* Set the XdndDirectSave0 property on the source window for this context */
196 static void set_xds_prop(GdkDragContext
*context
, char *text
)
198 gdk_property_change(context
->source_window
,
201 GDK_PROP_MODE_REPLACE
,
206 static char *get_xds_prop(GdkDragContext
*context
)
211 if (gdk_property_get(context
->source_window
,
217 &length
, &prop_text
) && prop_text
)
219 /* Terminate the string */
220 prop_text
= g_realloc(prop_text
, length
+ 1);
221 prop_text
[length
] = '\0';
228 /* Is the sender willing to supply this target type? */
229 static gboolean
provides(GdkDragContext
*context
, GdkAtom target
)
231 GList
*targets
= context
->targets
;
233 while (targets
&& ((GdkAtom
) targets
->data
!= target
))
234 targets
= targets
->next
;
236 return targets
!= NULL
;
239 /* Convert a URI to a local pathname (or NULL if it isn't local).
240 * The returned pointer points inside the input string.
247 static char *get_local_path(char *uri
)
251 host
= our_host_name();
258 return uri
; /* Just a local path - no host part */
260 path
= strchr(uri
+ 2, '/');
262 return NULL
; /* //something */
265 return path
; /* ///path */
266 if (strlen(host
) == path
- uri
- 2 &&
267 strncmp(uri
+ 2, host
, path
- uri
- 2) == 0)
268 return path
; /* //myhost/path */
270 return NULL
; /* From a different host */
274 if (strncasecmp(uri
, "file:", 5))
275 return NULL
; /* Don't know this format */
280 return get_local_path(uri
);
286 /* Convert a list of URIs into a list of strings.
287 * Lines beginning with # are skipped.
288 * The text block passed in is zero terminated (after the final CRLF)
290 static GSList
*uri_list_to_gslist(char *uri_list
)
300 linebreak
= strchr(uri_list
, 13);
302 if (!linebreak
|| linebreak
[1] != 10)
304 delayed_error("uri_list_to_gslist",
305 "Incorrect or missing line break "
306 "in text/uri-list data");
310 length
= linebreak
- uri_list
;
312 if (length
&& uri_list
[0] != '#')
314 uri
= g_malloc(sizeof(char) * (length
+ 1));
315 strncpy(uri
, uri_list
, length
);
317 list
= g_slist_append(list
, uri
);
320 uri_list
= linebreak
+ 2;
326 /* Append all the URIs in the selection to the string */
327 static void create_uri_list(GString
*string
,
328 Collection
*collection
,
329 FilerWindow
*filer_window
)
334 leader
= g_string_new("file://");
336 g_string_append(leader
, our_host_name());
337 g_string_append(leader
, filer_window
->path
);
338 if (leader
->str
[leader
->len
- 1] != '/')
339 g_string_append_c(leader
, '/');
341 num_selected
= collection
->number_selected
;
343 for (i
= 0; num_selected
> 0; i
++)
345 if (collection
->items
[i
].selected
)
347 FileItem
*item
= (FileItem
*) collection
->items
[i
].data
;
349 g_string_append(string
, leader
->str
);
350 g_string_append(string
, item
->leafname
);
351 g_string_append(string
, "\r\n");
356 g_string_free(leader
, TRUE
);
359 /* DRAGGING FROM US */
361 /* The user has held the mouse button down over an item and moved -
364 * We always provide text/uri-list. If we are dragging a single, regular file
365 * then we also offer application/octet-stream and the type of the file.
367 void drag_selection(Collection
*collection
,
368 GdkEventMotion
*event
,
369 gint number_selected
,
372 FilerWindow
*filer_window
= (FilerWindow
*) user_data
;
375 GdkDragContext
*context
;
376 GtkTargetList
*target_list
;
377 GtkTargetEntry target_table
[] =
379 {"text/uri-list", 0, TARGET_URI_LIST
},
380 {"application/octet-stream", 0, TARGET_RAW
},
385 if (number_selected
== 1)
386 item
= selected_item(collection
);
390 widget
= GTK_WIDGET(collection
);
392 if (item
&& item
->mime_type
)
394 MIME_type
*t
= item
->mime_type
;
396 target_table
[2].target
= g_strconcat(t
->media_type
, "/",
398 target_list
= gtk_target_list_new(target_table
, 3);
399 g_free(target_table
[2].target
);
402 target_list
= gtk_target_list_new(target_table
, 1);
404 context
= gtk_drag_begin(widget
,
406 GDK_ACTION_COPY
| GDK_ACTION_MOVE
| GDK_ACTION_LINK
,
407 (event
->state
& GDK_BUTTON1_MASK
) ? 1 : 2,
409 g_dataset_set_data(context
, "filer_window", filer_window
);
411 image
= item
? item
->image
: &default_pixmap
[TYPE_MULTIPLE
];
413 gtk_drag_set_icon_pixmap(context
,
414 gtk_widget_get_colormap(widget
),
420 /* Called when a remote app wants us to send it some data.
421 * TODO: Maybe we should handle errors better (ie, let the remote app know
422 * the drag has failed)?
424 void drag_data_get(GtkWidget
*widget
,
425 GdkDragContext
*context
,
426 GtkSelectionData
*selection_data
,
430 char *to_send
= "E"; /* Default to sending an error */
431 long to_send_length
= 1;
432 gboolean delete_once_sent
= FALSE
;
433 GdkAtom type
= XA_STRING
;
435 FilerWindow
*filer_window
;
438 filer_window
= g_dataset_get_data(context
, "filer_window");
439 g_return_if_fail(filer_window
!= NULL
);
444 item
= selected_item(filer_window
->collection
);
445 if (item
&& load_file(make_path(filer_window
->path
,
446 item
->leafname
)->str
,
447 &to_send
, &to_send_length
))
449 delete_once_sent
= TRUE
;
451 type
= type_to_atom(item
->mime_type
);
453 type
= application_octet_stream
;
457 case TARGET_URI_LIST
:
458 string
= g_string_new(NULL
);
459 create_uri_list(string
,
462 to_send
= string
->str
;
463 to_send_length
= string
->len
;
464 delete_once_sent
= TRUE
;
465 g_string_free(string
, FALSE
);
468 delayed_error("drag_data_get",
469 "Internal error - bad info type\n");
473 gtk_selection_data_set(selection_data
,
479 if (delete_once_sent
)
485 /* Set up this filer window as a drop target. Called once, when the
486 * filer window is first created.
488 void drag_set_dest(GtkWidget
*widget
, FilerWindow
*filer_window
)
490 GtkTargetEntry target_table
[] =
492 {"text/uri-list", 0, TARGET_URI_LIST
},
493 {"XdndDirectSave0", 0, TARGET_XDS
},
494 {"application/octet-stream", 0, TARGET_RAW
},
497 gtk_drag_dest_set(widget
,
498 0, /* GTK_DEST_DEFAULT_MOTION, */
500 sizeof(target_table
) / sizeof(*target_table
),
501 GDK_ACTION_COPY
| GDK_ACTION_MOVE
502 | GDK_ACTION_LINK
| GDK_ACTION_PRIVATE
);
504 gtk_signal_connect(GTK_OBJECT(widget
), "drag_motion",
505 GTK_SIGNAL_FUNC(drag_motion
), filer_window
);
506 gtk_signal_connect(GTK_OBJECT(widget
), "drag_leave",
507 GTK_SIGNAL_FUNC(drag_leave
), filer_window
);
508 gtk_signal_connect(GTK_OBJECT(widget
), "drag_drop",
509 GTK_SIGNAL_FUNC(drag_drop
), filer_window
);
510 gtk_signal_connect(GTK_OBJECT(widget
), "drag_data_received",
511 GTK_SIGNAL_FUNC(drag_data_received
), filer_window
);
514 /* Decide if panel drag is OK, setting drop_dest_type and drop_dest_path
515 * on the context as needed.
517 static gboolean
panel_drag_ok(FilerWindow
*filer_window
,
518 GdkDragContext
*context
,
521 FileItem
*fileitem
= NULL
;
524 char *type
= NULL
; /* Quiet gcc */
527 fileitem
= (FileItem
*)
528 filer_window
->collection
->items
[item
].data
;
531 new_path
= NULL
; /* Drag to panel background - disallow */
532 else if (fileitem
->flags
& (ITEM_FLAG_APPDIR
| ITEM_FLAG_EXEC_FILE
))
534 if (provides(context
, text_uri_list
))
536 type
= drop_dest_prog
;
537 new_path
= make_path(filer_window
->path
,
538 fileitem
->leafname
)->str
;
543 else if (fileitem
->base_type
== TYPE_DIRECTORY
)
545 type
= drop_dest_dir
;
546 new_path
= make_path(filer_window
->path
,
547 fileitem
->leafname
)->str
;
552 if (new_path
&& access(new_path
, W_OK
))
555 old_path
= g_dataset_get_data(context
, "drop_dest_path");
556 if (old_path
== new_path
||
557 (old_path
&& new_path
&& strcmp(old_path
, new_path
) == 0))
559 return new_path
!= NULL
; /* Same as before */
564 g_dataset_set_data(context
, "drop_dest_type", type
);
565 g_dataset_set_data_full(context
, "drop_dest_path",
566 g_strdup(new_path
), g_free
);
571 g_dataset_set_data(context
, "drop_dest_path", NULL
);
574 collection_set_cursor_item(filer_window
->collection
, item
);
576 return new_path
!= NULL
;
579 /* Called during the drag when the mouse is in a widget registered
580 * as a drop target. Returns TRUE if we can accept the drop.
582 static gboolean
drag_motion(GtkWidget
*widget
,
583 GdkDragContext
*context
,
588 FilerWindow
*filer_window
;
591 filer_window
= gtk_object_get_data(GTK_OBJECT(widget
), "filer_window");
592 g_return_val_if_fail(filer_window
!= NULL
, TRUE
);
594 if (gtk_drag_get_source_widget(context
) == widget
)
595 return FALSE
; /* Not within a single widget! */
597 if (filer_window
->panel
== FALSE
)
599 if (access(filer_window
->path
, W_OK
))
600 return FALSE
; /* We can't write here */
601 gdk_drag_status(context
, context
->suggested_action
, time
);
605 /* OK, this is a drag to a panel.
606 * Allow drags to directories, applications and X bit files only.
608 item
= collection_get_item(filer_window
->collection
, x
, y
);
610 if (panel_drag_ok(filer_window
, context
, item
))
612 gdk_drag_status(context
, context
->suggested_action
, time
);
619 /* Remove panel highlights */
620 static void drag_leave(GtkWidget
*widget
,
621 GdkDragContext
*context
)
623 FilerWindow
*filer_window
;
625 filer_window
= gtk_object_get_data(GTK_OBJECT(widget
), "filer_window");
626 g_return_if_fail(filer_window
!= NULL
);
628 collection_set_cursor_item(filer_window
->collection
, -1);
631 /* User has tried to drop some data on us. Decide what format we would
634 static gboolean
drag_drop(GtkWidget
*widget
,
635 GdkDragContext
*context
,
641 char *leafname
= NULL
;
642 FilerWindow
*filer_window
;
643 GdkAtom target
= GDK_NONE
;
645 char *dest_type
= NULL
;
647 filer_window
= gtk_object_get_data(GTK_OBJECT(widget
), "filer_window");
648 g_return_val_if_fail(filer_window
!= NULL
, TRUE
);
650 dest_path
= g_dataset_get_data(context
, "drop_dest_path");
651 if (dest_path
== NULL
)
653 if (filer_window
->panel
)
654 error
= "Bad drop on panel";
657 dest_path
= filer_window
->path
;
658 dest_type
= drop_dest_dir
;
663 dest_type
= g_dataset_get_data(context
, "drop_dest_type");
670 else if (dest_type
== drop_dest_dir
671 && provides(context
, XdndDirectSave0
))
673 leafname
= get_xds_prop(context
);
676 if (strchr(leafname
, '/'))
678 error
= "XDS protocol error: "
679 "leafname may not contain '/'\n";
688 uri
= g_string_new(NULL
);
689 g_string_sprintf(uri
, "file://%s%s",
693 set_xds_prop(context
, uri
->str
);
694 g_string_free(uri
, TRUE
);
696 target
= XdndDirectSave0
;
697 g_dataset_set_data_full(context
, "leafname",
702 error
= "XdndDirectSave0 target provided, but the atom "
703 "XdndDirectSave0 (type text/plain) did not "
704 "contain a leafname\n";
706 else if (provides(context
, text_uri_list
))
707 target
= text_uri_list
;
710 if (dest_type
== drop_dest_dir
)
711 error
= "Sorry - I require a target type of "
712 "text/uri-list or XdndDirectSave0.";
714 error
= "Sorry - I require a target type of "
720 gtk_drag_finish(context
, FALSE
, FALSE
, time
); /* Failure */
722 delayed_error("ROX-Filer", error
);
725 gtk_drag_get_data(widget
, context
, target
, time
);
730 /* Called when some data arrives from the remote app (which we asked for
733 static void drag_data_received(GtkWidget
*widget
,
734 GdkDragContext
*context
,
737 GtkSelectionData
*selection_data
,
741 if (!selection_data
->data
)
744 gtk_drag_finish(context
, FALSE
, FALSE
, time
); /* Failure */
751 got_data_xds_reply(widget
, context
,
752 selection_data
, time
);
755 got_data_raw(widget
, context
, selection_data
, time
);
757 case TARGET_URI_LIST
:
758 got_uri_list(widget
, context
, selection_data
, time
);
761 gtk_drag_finish(context
, FALSE
, FALSE
, time
);
762 delayed_error("drag_data_received", "Unknown target");
767 static void got_data_xds_reply(GtkWidget
*widget
,
768 GdkDragContext
*context
,
769 GtkSelectionData
*selection_data
,
772 gboolean mark_unsafe
= TRUE
;
773 char response
= *selection_data
->data
;
776 if (selection_data
->length
!= 1)
781 /* Sender couldn't save there - ask for another
784 if (provides(context
, application_octet_stream
))
786 mark_unsafe
= FALSE
; /* Wait and see */
788 gtk_drag_get_data(widget
, context
,
789 application_octet_stream
, time
);
792 error
= "Remote app can't or won't send me "
795 else if (response
== 'S')
797 FilerWindow
*filer_window
;
799 /* Success - data is saved */
800 mark_unsafe
= FALSE
; /* It really is safe */
801 gtk_drag_finish(context
, TRUE
, FALSE
, time
);
803 filer_window
= gtk_object_get_data(GTK_OBJECT(widget
),
805 g_return_if_fail(filer_window
!= NULL
);
807 update_dir(filer_window
);
809 else if (response
!= 'E')
811 error
= "XDS protocol error: "
812 "return code should be 'S', 'F' or 'E'\n";
814 /* else: error has been reported by the sender */
818 set_xds_prop(context
, "");
819 /* Unsave also implies that the drag failed */
820 gtk_drag_finish(context
, FALSE
, FALSE
, time
);
824 delayed_error("ROX-Filer", error
);
827 static void got_data_raw(GtkWidget
*widget
,
828 GdkDragContext
*context
,
829 GtkSelectionData
*selection_data
,
832 FilerWindow
*filer_window
;
838 filer_window
= gtk_object_get_data(GTK_OBJECT(widget
), "filer_window");
839 g_return_if_fail(filer_window
!= NULL
);
841 leafname
= g_dataset_get_data(context
, "leafname");
843 leafname
= "UntitledData";
845 dest_path
= get_dest_path(filer_window
, context
);
847 fd
= open(make_path(dest_path
, leafname
)->str
,
848 O_WRONLY
| O_CREAT
| O_EXCL
| O_NOCTTY
,
849 S_IRUSR
| S_IRGRP
| S_IROTH
|
850 S_IWUSR
| S_IWGRP
| S_IWOTH
);
853 error
= g_strerror(errno
);
857 selection_data
->data
,
858 selection_data
->length
) == -1)
859 error
= g_strerror(errno
);
861 if (close(fd
) == -1 && !error
)
862 error
= g_strerror(errno
);
864 update_dir(filer_window
);
869 if (provides(context
, XdndDirectSave0
))
870 set_xds_prop(context
, "");
871 gtk_drag_finish(context
, FALSE
, FALSE
, time
); /* Failure */
872 delayed_error("Error saving file", error
);
875 gtk_drag_finish(context
, TRUE
, FALSE
, time
); /* Success! */
878 /* Execute this program, passing all the URIs in the list as arguments.
879 * URIs that are files on the local machine will be passed as simple
880 * pathnames. The uri_list should be freed after this function returns.
882 static void run_with_files(char *path
, GSList
*uri_list
)
888 if (stat(path
, &info
))
890 delayed_error("ROX-Filer", "Program not found - deleted?");
894 argv
= g_malloc(sizeof(char *) * (g_slist_length(uri_list
) + 2));
896 if (S_ISDIR(info
.st_mode
))
897 argv
[argc
++] = make_path(path
, "AppRun")->str
;
903 char *uri
= (char *) uri_list
->data
;
906 local
= get_local_path(uri
);
908 argv
[argc
++] = local
;
911 uri_list
= uri_list
->next
;
916 if (!spawn_full(argv
, getenv("HOME"), 0))
917 delayed_error("ROX-Filer", "Failed to fork() child process");
920 /* We've got a list of URIs from somewhere (probably another filer window).
921 * If the files are on the local machine then try to copy them ourselves,
922 * otherwise, if there was only one file and application/octet-stream was
923 * provided, get the data via the X server.
925 static void got_uri_list(GtkWidget
*widget
,
926 GdkDragContext
*context
,
927 GtkSelectionData
*selection_data
,
930 FilerWindow
*filer_window
;
934 gboolean send_reply
= TRUE
;
938 filer_window
= gtk_object_get_data(GTK_OBJECT(widget
), "filer_window");
939 g_return_if_fail(filer_window
!= NULL
);
941 dest_path
= get_dest_path(filer_window
, context
);
942 type
= g_dataset_get_data(context
, "drop_dest_type");
944 uri_list
= uri_list_to_gslist(selection_data
->data
);
947 error
= "No URIs in the text/uri-list (nothing to do!)";
948 else if (type
== drop_dest_prog
)
949 run_with_files(dest_path
, uri_list
);
950 else if ((!uri_list
->next
) && (!get_local_path(uri_list
->data
)))
952 /* There is one URI in the list, and it's not on the local
953 * machine. Get it via the X server if possible.
956 if (provides(context
, application_octet_stream
))
959 leaf
= strrchr(uri_list
->data
, '/');
963 leaf
= uri_list
->data
;
964 g_dataset_set_data_full(context
, "leafname",
965 g_strdup(leaf
), g_free
);
966 gtk_drag_get_data(widget
, context
,
967 application_octet_stream
, time
);
971 error
= "Can't get data from remote machine "
972 "(application/octet-stream not provided)";
976 GSList
*local_paths
= NULL
;
979 /* Either one local URI, or a list. If everything in the list
980 * isn't local then we are stuck.
983 for (next_uri
= uri_list
; next_uri
; next_uri
= next_uri
->next
)
987 path
= get_local_path((char *) next_uri
->data
);
990 local_paths
= g_slist_append(local_paths
,
993 error
= "Some of these files are on a "
994 "different machine - they will be "
1000 error
= "None of these files are on the local machine "
1001 "- I can't operate on multiple remote files - "
1004 else if (context
->action
== GDK_ACTION_MOVE
)
1005 action_move(local_paths
, dest_path
);
1006 else if (context
->action
== GDK_ACTION_COPY
)
1007 action_copy(local_paths
, dest_path
);
1008 else if (context
->action
== GDK_ACTION_LINK
)
1009 action_link(local_paths
, dest_path
);
1011 error
= "Unknown action requested";
1013 for (next
= local_paths
; next
; next
= next
->next
)
1015 g_slist_free(local_paths
);
1020 gtk_drag_finish(context
, FALSE
, FALSE
, time
); /* Failure */
1021 delayed_error("Error getting file list", error
);
1023 else if (send_reply
)
1024 gtk_drag_finish(context
, TRUE
, FALSE
, time
); /* Success! */
1026 next_uri
= uri_list
;
1029 g_free(next_uri
->data
);
1030 next_uri
= next_uri
->next
;
1032 g_slist_free(uri_list
);