aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_view_controller.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2025-10-06 20:12:19 +0200
committerMarvin W <git@larma.de>2025-11-01 18:04:43 -0400
commitf1bbb065ec63053b1e0dd0c78ba11376cbab451d (patch)
treec8ba1ee43637b29f868e6d8ddd63714e6fb4618d /main/src/ui/conversation_view_controller.vala
parent3c37cdbd1d2e5abbd0ab46a110b479432929b535 (diff)
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.
Diffstat (limited to 'main/src/ui/conversation_view_controller.vala')
-rw-r--r--main/src/ui/conversation_view_controller.vala7
1 files changed, 5 insertions, 2 deletions
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));