properly construct file url when opening image/folder on linux (#3986)

This commit is contained in:
llama 2025-05-08 21:29:46 +08:00 committed by GitHub
parent 80618cad85
commit 9025202204
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -930,7 +930,7 @@ def openFolder(path: str) -> None:
subprocess.run(["explorer", f"file://{path}"], check=False)
else:
with no_bundled_libs():
QDesktopServices.openUrl(QUrl(f"file://{path}"))
QDesktopServices.openUrl(QUrl.fromLocalFile(path))
def show_in_folder(path: str) -> None:
@ -947,7 +947,7 @@ def show_in_folder(path: str) -> None:
else:
# Just open the file in any other platform
with no_bundled_libs():
QDesktopServices.openUrl(QUrl(f"file://{path}"))
QDesktopServices.openUrl(QUrl.fromLocalFile(path))
def _show_in_folder_win32(path: str) -> None: