mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix a regression that broke the "show book in main calibre program" link. Fixes #2110117 [link in e-viewer stopped working](https://bugs.launchpad.net/calibre/+bug/2110117)
This commit is contained in:
parent
d2363c0c0a
commit
9c42e1f7cc
@ -1179,7 +1179,10 @@ class Application(QApplication):
|
||||
shutdown_signal_received = pyqtSignal()
|
||||
palette_changed = pyqtSignal()
|
||||
|
||||
def __init__(self, args=(), force_calibre_style=False, override_program_name=None, headless=False, color_prefs=gprefs, windows_app_uid=None):
|
||||
def __init__(
|
||||
self, args=(), force_calibre_style=False, override_program_name=None, headless=False, color_prefs=gprefs, windows_app_uid=None,
|
||||
should_handle_calibre_urls=False
|
||||
):
|
||||
if not args:
|
||||
args = sys.argv[:1]
|
||||
args = [args[0]]
|
||||
@ -1213,8 +1216,9 @@ class Application(QApplication):
|
||||
QApplication.setDesktopFileName(override_program_name)
|
||||
QApplication.setAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts, True) # needed for webengine
|
||||
QApplication.__init__(self, args)
|
||||
# See https://bugreports.qt.io/browse/QTBUG-134316
|
||||
QDesktopServices.setUrlHandler('calibre', self.handle_calibre_url)
|
||||
if should_handle_calibre_urls:
|
||||
# See https://bugreports.qt.io/browse/QTBUG-134316
|
||||
QDesktopServices.setUrlHandler('calibre', self.handle_calibre_url)
|
||||
set_image_allocation_limit()
|
||||
self.palette_manager.initialize()
|
||||
icon_resource_manager.initialize()
|
||||
|
@ -115,7 +115,7 @@ def init_qt(args):
|
||||
prefs.set('library_path', os.path.abspath(libpath))
|
||||
prints('Using library at', prefs['library_path'])
|
||||
override = 'calibre-gui' if islinux else None
|
||||
app = Application(args, override_program_name=override, windows_app_uid=MAIN_APP_UID)
|
||||
app = Application(args, override_program_name=override, windows_app_uid=MAIN_APP_UID, should_handle_calibre_urls=True)
|
||||
|
||||
app.file_event_hook = EventAccumulator()
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user