mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Refactor OpenDirectory method to standardize parameter naming and improve path handling
This commit is contained in:
parent
050c2cb647
commit
b5bbd9f123
1 changed files with 10 additions and 10 deletions
|
|
@ -314,19 +314,19 @@ namespace Flow.Launcher
|
|||
((PluginJsonStorage<T>)_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)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue