Book details: Fix a regression in the previous release that broke the right click search the internet function

Fixes #1842090 ["Search the internet for..." right-click options fail](https://bugs.launchpad.net/calibre/+bug/1842090)
This commit is contained in:
Kovid Goyal 2019-08-30 20:57:05 +05:30
parent 05834f0b42
commit 1156e8209a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1145,6 +1145,8 @@ def open_url(qurl):
def safe_open_url(qurl):
if isinstance(qurl, string_or_bytes):
qurl = QUrl(qurl)
if qurl.scheme() in ('', 'file'):
path = qurl.toLocalFile()
ext = os.path.splitext(path)[-1].lower()[1:]