macOS: Fix calibre:// URLs not working from other documents

This commit is contained in:
Kovid Goyal 2020-11-21 09:26:59 +05:30
parent 33dbbb2bee
commit 4265c87463
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1153,6 +1153,12 @@ class Application(QApplication):
def event(self, e):
if callable(self.file_event_hook) and e.type() == QEvent.FileOpen:
url = e.url().toString(QUrl.FullyEncoded)
if url and url.startswith('calibre://'):
with self._file_open_lock:
self._file_open_paths.append(url)
QTimer.singleShot(1000, self._send_file_open_events)
return True
path = unicode_type(e.file())
if os.access(path, os.R_OK):
with self._file_open_lock: