mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
93bde3df4d
commit
0fc95de045
@ -1464,14 +1464,13 @@ def open_url(qurl):
|
|||||||
ensure_app()
|
ensure_app()
|
||||||
ok = QDesktopServices.openUrl(qurl)
|
ok = QDesktopServices.openUrl(qurl)
|
||||||
if not ok:
|
if not ok:
|
||||||
# this happens a lot with Qt 6.5.3 on some Linux distros
|
# this happens a lot with Qt 6.5.3. On Wayland, Qt requires
|
||||||
print('QDesktopServices.openUrl() failed for url:', qurl, file=sys.stderr)
|
# BOTH a QApplication AND a top level window so it can use the
|
||||||
|
# xdg activation token system Wayland imposes.
|
||||||
|
print('QDesktopServices::openUrl() failed for url:', qurl, file=sys.stderr)
|
||||||
if islinux:
|
if islinux:
|
||||||
import subprocess
|
import subprocess
|
||||||
if qurl.isLocalFile():
|
cmd = ['xdg-open', qurl.toLocalFile() if qurl.isLocalFile() else qurl.toString()]
|
||||||
cmd = ['xdg-open', qurl.toLocalFile()]
|
|
||||||
else:
|
|
||||||
cmd = ['xdg-open', qurl.toString()]
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print('Running opener:', cmd)
|
print('Running opener:', cmd)
|
||||||
subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user