From 90252022041bdbf8f257a96d4e32eb272890b527 Mon Sep 17 00:00:00 2001 From: llama <100429699+iamllama@users.noreply.github.com> Date: Thu, 8 May 2025 21:29:46 +0800 Subject: [PATCH] properly construct file url when opening image/folder on linux (#3986) --- qt/aqt/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index db45a10e9..a11eb14b7 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -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: