Skip to content

Commit a1353d5

Browse files
committed
Update start process for opening directory
1 parent ef0cd2b commit a1353d5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace Flow.Launcher.Plugin.SharedCommands
77
{
88
public static class FilesFolders
99
{
10+
private const string FileExplorerProgramName = "explorer";
1011
public static void Copy(this string sourcePath, string targetPath)
1112
{
1213
// Get the subdirectories for the specified directory.
@@ -114,7 +115,7 @@ public static void OpenLocationInExporer(string location)
114115
try
115116
{
116117
if (LocationExists(location))
117-
Process.Start(location);
118+
Process.Start(FileExplorerProgramName, location);
118119
}
119120
catch (Exception e)
120121
{

Plugins/Flow.Launcher.Plugin.Folder/Main.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Windows.Controls;
88
using Flow.Launcher.Infrastructure;
99
using Flow.Launcher.Infrastructure.Storage;
10+
using Flow.Launcher.Plugin.SharedCommands;
1011

1112
namespace Flow.Launcher.Plugin.Folder
1213
{
@@ -18,8 +19,7 @@ public class Main : IPlugin, ISettingProvider, IPluginI18n, ISavable, IContextMe
1819
public const string CopyImagePath = "Images\\copy.png";
1920

2021
private string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory";
21-
22-
private const string _fileExplorerProgramName = "explorer";
22+
2323
private static List<string> _driverNames;
2424
private PluginInitContext _context;
2525

@@ -103,7 +103,7 @@ private Result CreateFolderResult(string title, string subtitle, string path, Qu
103103
{
104104
try
105105
{
106-
Process.Start(_fileExplorerProgramName, path);
106+
FilesFolders.OpenLocationInExporer(path);
107107
return true;
108108
}
109109
catch (Exception ex)
@@ -255,7 +255,7 @@ private static Result CreateFileResult(string filePath, Query query)
255255
{
256256
try
257257
{
258-
Process.Start(_fileExplorerProgramName, filePath);
258+
FilesFolders.OpenLocationInExporer(filePath);
259259
}
260260
catch (Exception ex)
261261
{
@@ -286,7 +286,7 @@ private static Result CreateOpenCurrentFolderResult(string incompleteName, strin
286286
Score = 500,
287287
Action = c =>
288288
{
289-
Process.Start(_fileExplorerProgramName, search);
289+
FilesFolders.OpenLocationInExporer(search);
290290
return true;
291291
}
292292
};

0 commit comments

Comments
 (0)