Use QDesktopServices to open cover images instead of webbrowser2

QDesktopServices takes care of honoring the user configuration so
when opening an image, the user preferred external app is used
instead of always using a web browser.

Fixes PICARD-1501
This commit is contained in:
Antonio Larrosa
2019-04-03 20:04:05 +02:00
committed by Philipp Wolfer
parent 86ea3c11f7
commit 29c2f45de1

View File

@@ -38,8 +38,7 @@ from picard.util import (
encode_filename,
format_time,
htmlescape,
union_sorted_lists,
webbrowser2,
union_sorted_lists
)
from picard.ui import PicardDialog
@@ -243,7 +242,8 @@ class InfoDialog(PicardDialog):
return
filename = data.tempfile_filename
if filename:
webbrowser2.open("file://" + filename)
url = QtCore.QUrl.fromLocalFile(filename)
QtGui.QDesktopServices.openUrl(url)
def format_file_info(file_):