@@ -25,11 +25,12 @@ namespace Files {
2525
2626 public DndHandler () {}
2727
28- public bool dnd_perform (Gtk .Widget widget ,
29- Files .File drop_target ,
30- GLib .List<GLib . File > drop_file_list ,
31- Gdk .DragAction action )
32- requires (drop_target != null && drop_file_list != null ) {
28+ public bool dnd_perform (
29+ Gtk .Widget widget ,
30+ Files .File drop_target ,
31+ GLib .List<GLib . File > drop_file_list ,
32+ Gdk .DragAction action
33+ ) requires (drop_target != null && drop_file_list != null ) {
3334
3435 if (drop_target. is_folder ()) {
3536 Files . FileOperations . copy_move_link. begin (
@@ -57,9 +58,11 @@ namespace Files {
5758 return false ;
5859 }
5960
60- public Gdk .DragAction ? drag_drop_action_ask (Gtk .Widget dest_widget ,
61- Gtk .ApplicationWindow win ,
62- Gdk .DragAction possible_actions ) {
61+ public Gdk .DragAction ? drag_drop_action_ask (
62+ Gtk .Widget dest_widget ,
63+ Gtk .ApplicationWindow win ,
64+ Gdk .DragAction possible_actions
65+ ) {
6366
6467 this . chosen = Gdk . DragAction . DEFAULT ;
6568 add_action (win);
@@ -107,8 +110,12 @@ namespace Files {
107110 return menu;
108111 }
109112
110- private void build_and_append_menu_item (Gtk .Menu menu , string label , Gdk .DragAction ? action ,
111- Gdk .DragAction possible_actions ) {
113+ private void build_and_append_menu_item (
114+ Gtk .Menu menu ,
115+ string label ,
116+ Gdk .DragAction ? action ,
117+ Gdk .DragAction possible_actions
118+ ) {
112119
113120 if ((possible_actions & action) != 0 ) {
114121 var item = new Gtk .MenuItem .with_label (label);
@@ -189,9 +196,12 @@ namespace Files {
189196 uri. length);
190197 }
191198
192- public bool handle_xdnddirectsave (Gdk .Window source_window ,
193- Files .File drop_target ,
194- Gtk .SelectionData selection ) {
199+ public bool handle_xdnddirectsave (
200+ Gdk .Window source_window ,
201+ Files .File drop_target ,
202+ Gtk .SelectionData selection
203+ ) {
204+
195205 bool success = false ;
196206
197207 if (selection != null &&
@@ -225,7 +235,12 @@ namespace Files {
225235 return success;
226236 }
227237
228- public bool handle_netscape_url (Gdk .Window source_window , Files .File drop_target , Gtk .SelectionData selection ) {
238+ public bool handle_netscape_url (
239+ Gdk .Window source_window ,
240+ Files .File drop_target ,
241+ Gtk .SelectionData selection
242+ ) {
243+
229244 string [] parts = (selection. get_text ()). split (" \n " );
230245
231246 /* _NETSCAPE_URL looks like this: "$URL\n$TITLE" - should be 2 parts */
@@ -237,13 +252,15 @@ namespace Files {
237252 return false ;
238253 }
239254
240- public bool handle_file_drag_actions (Gtk .Widget dest_widget ,
241- Files .File drop_target ,
242- GLib .List<GLib . File > drop_file_list ,
243- Gdk .DragAction possible_actions ,
244- Gdk .DragAction suggested_action ,
245- Gtk .ApplicationWindow win ,
246- uint32 timestamp ) {
255+ public bool handle_file_drag_actions (
256+ Gtk .Widget dest_widget ,
257+ Files .File drop_target ,
258+ GLib .List<GLib . File > drop_file_list ,
259+ Gdk .DragAction possible_actions ,
260+ Gdk .DragAction suggested_action ,
261+ Gtk .ApplicationWindow win ,
262+ uint32 timestamp
263+ ) {
247264
248265 bool success = false ;
249266 Gdk . DragAction action = suggested_action;
@@ -268,7 +285,12 @@ namespace Files {
268285 }
269286
270287
271- public static bool selection_data_is_uri_list (Gtk .SelectionData selection_data , uint info , out string ? text ) {
288+ public static bool selection_data_is_uri_list (
289+ Gtk .SelectionData selection_data ,
290+ uint info ,
291+ out string ? text
292+ ) {
293+
272294 text = null ;
273295
274296 if (info == Files . TargetType . TEXT_URI_LIST &&
@@ -295,9 +317,11 @@ namespace Files {
295317 }
296318
297319 // Used when TargetType is TEXT_URI_LIST
298- public static void set_selection_data_as_file_list (Gtk .SelectionData selection_data ,
299- GLib .List<Files . File > file_list ,
300- string prefix = "") {
320+ public static void set_selection_data_as_file_list (
321+ Gtk .SelectionData selection_data ,
322+ GLib .List<Files . File > file_list ,
323+ string prefix = ""
324+ ) {
301325
302326 GLib . StringBuilder sb = new GLib .StringBuilder (prefix);
303327 set_stringbuilder_from_file_list (
@@ -312,9 +336,11 @@ namespace Files {
312336 }
313337
314338 // Used when TargetType is STRING
315- public static void set_selection_data_as_text (Gtk .SelectionData selection_data ,
316- GLib .List<Files . File > file_list ,
317- string prefix = "") {
339+ public static void set_selection_data_as_text (
340+ Gtk .SelectionData selection_data ,
341+ GLib .List<Files . File > file_list ,
342+ string prefix = ""
343+ ) {
318344
319345 GLib . StringBuilder sb = new GLib .StringBuilder (prefix);
320346 set_stringbuilder_from_file_list (
@@ -326,9 +352,11 @@ namespace Files {
326352 selection_data. set_text (sb. str, (int )(sb. len));
327353 }
328354
329- private static void set_stringbuilder_from_file_list (GLib .StringBuilder sb ,
330- GLib .List<Files . File > file_list ,
331- TargetType type ) {
355+ private static void set_stringbuilder_from_file_list (
356+ GLib .StringBuilder sb ,
357+ GLib .List<Files . File > file_list ,
358+ TargetType type
359+ ) {
332360
333361 if (file_list != null && file_list. data != null && file_list. data is Files . File ) {
334362 bool in_recent = file_list. data. is_recent_uri_scheme ();
@@ -349,11 +377,13 @@ namespace Files {
349377 }
350378 }
351379
352- public static Gdk .DragAction file_accepts_drop (Files .File dest ,
353- GLib .List<GLib . File > drop_file_list , // read -only
354- Gdk .DragAction selected_action ,
355- Gdk .DragAction possible_actions ,
356- out Gdk .DragAction suggested_action_return ) {
380+ public static Gdk .DragAction file_accepts_drop (
381+ Files .File dest ,
382+ GLib .List<GLib . File > drop_file_list , // read -only
383+ Gdk .DragAction selected_action , // may be null - ignore
384+ Gdk .DragAction possible_actions ,
385+ out Gdk .DragAction suggested_action_return
386+ ) {
357387
358388 var actions = possible_actions;
359389 var suggested_action = selected_action;
@@ -404,9 +434,11 @@ namespace Files {
404434 }
405435
406436 private const uint MAX_FILES_CHECKED = 100 ; // Max checked copied from gof_file.c version
407- private static Gdk .DragAction valid_actions_for_file_list (GLib .File target_location ,
408- GLib .List<GLib . File > drop_file_list ,
409- ref Gdk .DragAction suggested_action ) {
437+ private static Gdk .DragAction valid_actions_for_file_list (
438+ GLib .File target_location ,
439+ GLib .List<GLib . File > drop_file_list ,
440+ ref Gdk .DragAction suggested_action
441+ ) {
410442
411443 var valid_actions = Gdk . DragAction . DEFAULT |
412444 Gdk . DragAction . COPY |
0 commit comments