From f1bbb065ec63053b1e0dd0c78ba11376cbab451d Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 6 Oct 2025 20:12:19 +0200 Subject: Files: Use GFile instead of uri/path strings In some situations (like VFS or other abstractions), the file reference can have an invalid or unusabe path. Passing the GFile instead and opening it directly increases probability we can actually access it. --- main/src/ui/conversation_view_controller.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'main/src/ui/conversation_view_controller.vala') diff --git a/main/src/ui/conversation_view_controller.vala b/main/src/ui/conversation_view_controller.vala index 1662ae56..2e11e1e9 100644 --- a/main/src/ui/conversation_view_controller.vala +++ b/main/src/ui/conversation_view_controller.vala @@ -203,7 +203,7 @@ public class ConversationViewController : Object { FileChooserNative chooser = new FileChooserNative(_("Select file"), view.get_root() as Gtk.Window, FileChooserAction.OPEN, _("Select"), _("Cancel")); chooser.response.connect((response) => { if (response == ResponseType.ACCEPT) { - open_send_file_overlay(File.new_for_path(chooser.get_file().get_path())); + open_send_file_overlay(chooser.get_file()); } }); chooser.show(); @@ -213,7 +213,10 @@ public class ConversationViewController : Object { FileInfo file_info; try { file_info = file.query_info("*", FileQueryInfoFlags.NONE); - } catch (Error e) { return; } + } catch (Error e) { + warning("Failed querying info for file %s", file.get_path()); + return; + } FileSendOverlay overlay = new FileSendOverlay(file, file_info); overlay.send_file.connect(() => send_file(file)); -- cgit v1.3