Skip to content

Commit b5bbd9f

Browse files
committed
Refactor OpenDirectory method to standardize parameter naming and improve path handling
1 parent 050c2cb commit b5bbd9f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -314,19 +314,19 @@ public void SavePluginSettings()
314314
((PluginJsonStorage<T>)_pluginJsonStorages[type]).Save();
315315
}
316316

317-
public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null)
317+
public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null)
318318
{
319319
string targetPath;
320320

321-
if (fileNameOrFilePath is null)
321+
if (FileNameOrFilePath is null)
322322
{
323-
targetPath = directoryPath;
323+
targetPath = DirectoryPath;
324324
}
325325
else
326326
{
327-
targetPath = Path.IsPathRooted(fileNameOrFilePath)
328-
? fileNameOrFilePath
329-
: Path.Combine(directoryPath, fileNameOrFilePath);
327+
targetPath = Path.IsPathRooted(FileNameOrFilePath)
328+
? FileNameOrFilePath
329+
: Path.Combine(DirectoryPath, FileNameOrFilePath);
330330
}
331331

332332
var explorerInfo = _settings.CustomExplorer;
@@ -346,12 +346,12 @@ public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null
346346
// Custom File Manager
347347
var psi = new ProcessStartInfo
348348
{
349-
FileName = explorerInfo.Path.Replace("%d", directoryPath),
349+
FileName = explorerInfo.Path.Replace("%d", DirectoryPath),
350350
UseShellExecute = true,
351-
Arguments = fileNameOrFilePath is null
352-
? explorerInfo.DirectoryArgument.Replace("%d", directoryPath)
351+
Arguments = FileNameOrFilePath is null
352+
? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath)
353353
: explorerInfo.FileArgument
354-
.Replace("%d", directoryPath)
354+
.Replace("%d", DirectoryPath)
355355
.Replace("%f", targetPath)
356356
};
357357

0 commit comments

Comments
 (0)