From 1ab785fbbc4b0f868b5096884139a6420455bffc Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Fri, 12 Apr 2024 20:02:00 +0800 Subject: [PATCH] fix: open Dir --- lib/common/helper/system_helper.dart | 2 +- lib/ui/home/home_ui.dart | 2 +- lib/ui/home/localization/localization_ui_model.dart | 2 +- lib/ui/settings/upgrade_dialog.dart | 2 +- lib/ui/tools/tools_ui_model.dart | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/common/helper/system_helper.dart b/lib/common/helper/system_helper.dart index 1fd3096..78ae102 100644 --- a/lib/common/helper/system_helper.dart +++ b/lib/common/helper/system_helper.dart @@ -258,7 +258,7 @@ foreach ($adapter in $adapterMemory) { static Future openDir(path, {bool isFile = false}) async { dPrint("SystemHelper.openDir path === $path"); await Process.run( - SystemHelper.powershellPath, ["explorer.exe", isFile ? "/select,$path" : "/select,\"\"$path\"\""]); + SystemHelper.powershellPath, ["explorer.exe", isFile ? "/select,$path" : "\"/select,\"$path\"\""]); } static String getHostsFilePath() { diff --git a/lib/ui/home/home_ui.dart b/lib/ui/home/home_ui.dart index 5ac4c8d..fade09f 100644 --- a/lib/ui/home/home_ui.dart +++ b/lib/ui/home/home_ui.dart @@ -169,7 +169,7 @@ class HomeUI extends HookConsumerWidget { const SizedBox(width: 12), Button( onPressed: () => - SystemHelper.openDir("\"${homeState.scInstalledPath}\""), + SystemHelper.openDir("${homeState.scInstalledPath}"), child: const Padding( padding: EdgeInsets.all(6), child: Icon(FluentIcons.folder_open), diff --git a/lib/ui/home/localization/localization_ui_model.dart b/lib/ui/home/localization/localization_ui_model.dart index 129f661..d786f91 100644 --- a/lib/ui/home/localization/localization_ui_model.dart +++ b/lib/ui/home/localization/localization_ui_model.dart @@ -265,7 +265,7 @@ class LocalizationUIModel extends _$LocalizationUIModel { openDir(BuildContext context) async { showToast(context, S.current.localization_info_custom_file_instructions); - SystemHelper.openDir("\"${_customizeDir.absolute.path}\"\\"); + SystemHelper.openDir(_customizeDir.absolute.path); } VoidCallback? doRemoteInstall( diff --git a/lib/ui/settings/upgrade_dialog.dart b/lib/ui/settings/upgrade_dialog.dart index 41eac83..9042759 100644 --- a/lib/ui/settings/upgrade_dialog.dart +++ b/lib/ui/settings/upgrade_dialog.dart @@ -259,7 +259,7 @@ class UpgradeDialogUI extends HookConsumerWidget { progress.value = 0; if (!context.mounted) return; showToast(context, S.current.app_upgrade_info_run_failed); - SystemHelper.openDir("\"$fileName\""); + SystemHelper.openDir(fileName); } } } diff --git a/lib/ui/tools/tools_ui_model.dart b/lib/ui/tools/tools_ui_model.dart index c3604ce..a9da6f4 100644 --- a/lib/ui/tools/tools_ui_model.dart +++ b/lib/ui/tools/tools_ui_model.dart @@ -361,7 +361,7 @@ class ToolsUIModel extends _$ToolsUIModel { } openDir(path) async { - SystemHelper.openDir("\"$path\""); + SystemHelper.openDir(path); } Future _showSystemInfo(BuildContext context) async {