This commit is contained in:
Kovid Goyal 2014-08-24 01:46:45 +05:30
parent df49debcf8
commit ca693798c3

View File

@ -874,8 +874,7 @@ def setup_gui_option_parser(parser):
parser.add_option('--detach', default=False, action='store_true', parser.add_option('--detach', default=False, action='store_true',
help=_('Detach from the controlling terminal, if any (linux only)')) help=_('Detach from the controlling terminal, if any (linux only)'))
def detach_gui(): def do_detach():
if islinux and not DEBUG:
# Detach from the controlling process. # Detach from the controlling process.
if os.fork() != 0: if os.fork() != 0:
raise SystemExit(0) raise SystemExit(0)
@ -885,6 +884,10 @@ def detach_gui():
except AttributeError: except AttributeError:
pass # people running from source without updated binaries pass # people running from source without updated binaries
def detach_gui():
if islinux and not DEBUG:
do_detach()
class Application(QApplication): class Application(QApplication):
def __init__(self, args, force_calibre_style=False, override_program_name=None, headless=False): def __init__(self, args, force_calibre_style=False, override_program_name=None, headless=False):