mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
env var to override the headless platform used by Qt
This commit is contained in:
parent
f0c0378e92
commit
cc9afd6371
@ -1189,10 +1189,9 @@ class Application(QApplication):
|
||||
args = [override_program_name] + args[1:]
|
||||
self.palette_manager = PaletteManager(force_calibre_style, headless)
|
||||
if headless:
|
||||
args.extend(('-platformpluginpath', plugins_loc, '-platform', 'headless'))
|
||||
args.extend(('-platformpluginpath', plugins_loc, '-platform', os.environ.get('CALIBRE_HEADLESS_PLATFORM', 'headless')))
|
||||
else:
|
||||
args.extend(self.palette_manager.args_to_qt)
|
||||
|
||||
self.headless = headless
|
||||
from calibre_extensions import progress_indicator
|
||||
self.pi = progress_indicator
|
||||
@ -1583,7 +1582,7 @@ def ensure_app(headless=True):
|
||||
args = sys.argv[:1]
|
||||
has_headless = ismacos or islinux or isbsd
|
||||
if headless and has_headless:
|
||||
args += ['-platformpluginpath', plugins_loc, '-platform', 'headless']
|
||||
args += ['-platformpluginpath', plugins_loc, '-platform', os.environ.get('CALIBRE_HEADLESS_PLATFORM', 'headless')]
|
||||
if ismacos:
|
||||
os.environ['QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM'] = '1'
|
||||
if headless and iswindows:
|
||||
|
Loading…
x
Reference in New Issue
Block a user