From 9c27ed29ae6faaa7d3de1a53dea02c4ed527e218 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 20 Jul 2016 20:31:34 +0100 Subject: [PATCH] [#2768] [GTKUI] [OSX] Fix invalid file error at startup When installed to the system, not using .app, error is raised on startup as nsapp_open_file is ignoring Deluge-bin but not deluge or deluge-gtk for potential 'filename' when connecting NSApplicationOpenFile. --- deluge/ui/gtkui/gtkui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 39fc71e20..3709451fa 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -203,8 +203,8 @@ class GtkUI(object): if deluge.common.osx_check() and gtk.gdk.WINDOWING == "quartz": def nsapp_open_file(osxapp, filename): - # Will be raised at app launch (python opening main script) - if filename.endswith('Deluge-bin'): + # Ignore command name which is raised at app launch (python opening main script). + if filename == sys.argv[0]: return True process_args([filename]) self.osxapp.connect("NSApplicationOpenFile", nsapp_open_file)