mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
macOS: Fix calibre:// URLs not working from other documents
This commit is contained in:
parent
33dbbb2bee
commit
4265c87463
@ -1153,6 +1153,12 @@ class Application(QApplication):
|
|||||||
|
|
||||||
def event(self, e):
|
def event(self, e):
|
||||||
if callable(self.file_event_hook) and e.type() == QEvent.FileOpen:
|
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())
|
path = unicode_type(e.file())
|
||||||
if os.access(path, os.R_OK):
|
if os.access(path, os.R_OK):
|
||||||
with self._file_open_lock:
|
with self._file_open_lock:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user