Update start process for opening directory

This commit is contained in:
Jeremy Wu 2020-04-23 21:56:11 +10:00
parent ef0cd2bf7c
commit a1353d5249
2 changed files with 7 additions and 6 deletions

View file

@ -7,6 +7,7 @@ namespace Flow.Launcher.Plugin.SharedCommands
{
public static class FilesFolders
{
private const string FileExplorerProgramName = "explorer";
public static void Copy(this string sourcePath, string targetPath)
{
// Get the subdirectories for the specified directory.
@ -114,7 +115,7 @@ namespace Flow.Launcher.Plugin.SharedCommands
try
{
if (LocationExists(location))
Process.Start(location);
Process.Start(FileExplorerProgramName, location);
}
catch (Exception e)
{

View file

@ -7,6 +7,7 @@ using System.Windows;
using System.Windows.Controls;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Plugin.SharedCommands;
namespace Flow.Launcher.Plugin.Folder
{
@ -18,8 +19,7 @@ namespace Flow.Launcher.Plugin.Folder
public const string CopyImagePath = "Images\\copy.png";
private string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory";
private const string _fileExplorerProgramName = "explorer";
private static List<string> _driverNames;
private PluginInitContext _context;
@ -103,7 +103,7 @@ namespace Flow.Launcher.Plugin.Folder
{
try
{
Process.Start(_fileExplorerProgramName, path);
FilesFolders.OpenLocationInExporer(path);
return true;
}
catch (Exception ex)
@ -255,7 +255,7 @@ namespace Flow.Launcher.Plugin.Folder
{
try
{
Process.Start(_fileExplorerProgramName, filePath);
FilesFolders.OpenLocationInExporer(filePath);
}
catch (Exception ex)
{
@ -286,7 +286,7 @@ namespace Flow.Launcher.Plugin.Folder
Score = 500,
Action = c =>
{
Process.Start(_fileExplorerProgramName, search);
FilesFolders.OpenLocationInExporer(search);
return true;
}
};