From b5bbd9f123ede83f9fe53732a28bb17952c60b21 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 17 May 2025 15:16:34 +0900 Subject: [PATCH] Refactor OpenDirectory method to standardize parameter naming and improve path handling --- Flow.Launcher/PublicAPIInstance.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 28b4b0429..ad48081b4 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -314,19 +314,19 @@ namespace Flow.Launcher ((PluginJsonStorage)_pluginJsonStorages[type]).Save(); } - public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null) + public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null) { string targetPath; - if (fileNameOrFilePath is null) + if (FileNameOrFilePath is null) { - targetPath = directoryPath; + targetPath = DirectoryPath; } else { - targetPath = Path.IsPathRooted(fileNameOrFilePath) - ? fileNameOrFilePath - : Path.Combine(directoryPath, fileNameOrFilePath); + targetPath = Path.IsPathRooted(FileNameOrFilePath) + ? FileNameOrFilePath + : Path.Combine(DirectoryPath, FileNameOrFilePath); } var explorerInfo = _settings.CustomExplorer; @@ -346,12 +346,12 @@ namespace Flow.Launcher // Custom File Manager var psi = new ProcessStartInfo { - FileName = explorerInfo.Path.Replace("%d", directoryPath), + FileName = explorerInfo.Path.Replace("%d", DirectoryPath), UseShellExecute = true, - Arguments = fileNameOrFilePath is null - ? explorerInfo.DirectoryArgument.Replace("%d", directoryPath) + Arguments = FileNameOrFilePath is null + ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) : explorerInfo.FileArgument - .Replace("%d", directoryPath) + .Replace("%d", DirectoryPath) .Replace("%f", targetPath) };