From 80380b230a56aa25ed4d622e0f91bdef9926e80a Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 19 May 2020 13:40:38 +1000 Subject: [PATCH] Change Search to open using shared command --- .../Search/WindowsIndex/Searcher.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/Searcher.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/Searcher.cs index d36948079..21067056d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/Searcher.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/Searcher.cs @@ -1,4 +1,5 @@ using Flow.Launcher.Infrastructure.Logger; +using Flow.Launcher.Plugin.SharedCommands; using System; using System.Collections.Generic; using System.ComponentModel; @@ -45,7 +46,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex { if (dataReaderResults.GetValue(0) != DBNull.Value && dataReaderResults.GetValue(1) != DBNull.Value) { - results.Add(CreateResult(dataReaderResults)); + results.Add(CreateResult(dataReaderResults.GetString(0), dataReaderResults.GetString(1))); } } } @@ -65,23 +66,18 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex return results; } - private Result CreateResult(OleDbDataReader dataReaderResults) + private Result CreateResult(string filename, string path) { return new Result { - Title = dataReaderResults.GetString(0), - SubTitle = dataReaderResults.GetString(1), + Title = filename, + SubTitle = path, IcoPath = "Images\\Explorer.png",//<------CHANGE Action = c => { try { - Process.Start(new ProcessStartInfo - { - FileName = dataReaderResults.GetString(1), - UseShellExecute = true, - //WorkingDirectory = workingDir <----?? - }); + FilesFolders.OpenPath(path); } catch (Win32Exception) {