diff --git a/Flow.Launcher.Test/Plugins/ExplorerTest.cs b/Flow.Launcher.Test/Plugins/ExplorerTest.cs index f4028b27d..6f3c41aff 100644 --- a/Flow.Launcher.Test/Plugins/ExplorerTest.cs +++ b/Flow.Launcher.Test/Plugins/ExplorerTest.cs @@ -24,7 +24,7 @@ namespace Flow.Launcher.Test.Plugins $"Actual: {result}{Environment.NewLine}"); } - [TestCase("C:\\Dropbox", "SELECT TOP 100 System.FileName, System.ItemPathDisplay FROM SystemIndex WHERE directory='file:C:\\Dropbox'")] + [TestCase("C:\\Dropbox", "SELECT TOP 100 System.FileName, System.ItemPathDisplay, System.ItemType FROM SystemIndex WHERE directory='file:C:\\Dropbox'")] public void GivenWindowsIndexSearch_WhenSearchTypeIsSearchTopFolderLevel_ThenQueryShouldUseExpectedString(string folderPath, string expectedString) { // Given @@ -52,7 +52,7 @@ namespace Flow.Launcher.Test.Plugins $"Actual string was: {resultString}{Environment.NewLine}"); } - [TestCase("flow.launcher.sln", "SELECT TOP 100 \"System.FileName\", \"System.ItemPathDisplay\" " + + [TestCase("flow.launcher.sln", "SELECT TOP 100 \"System.FileName\", \"System.ItemPathDisplay\", \"System.ItemType\" " + "FROM \"SystemIndex\" WHERE (System.FileName LIKE 'flow.launcher.sln%' " + "OR CONTAINS(System.FileName,'\"flow.launcher.sln*\"',1033)) AND scope='file:'")] public void GivenWindowsIndexSearch_WhenSearchAllFoldersAndFiles_ThenQueryShouldUseExpectedString( diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj index 2de4a4149..0261da36b 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj @@ -27,6 +27,22 @@ PreserveNewest + + + PreserveNewest + + + + Always + + + + PreserveNewest + + + + PreserveNewest + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Images/copy.png b/Plugins/Flow.Launcher.Plugin.Explorer/Images/copy.png new file mode 100644 index 000000000..8f1fca752 Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/Images/copy.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Images/deletefilefolder.png b/Plugins/Flow.Launcher.Plugin.Explorer/Images/deletefilefolder.png new file mode 100644 index 000000000..024cc9291 Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/Images/deletefilefolder.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Images/file.png b/Plugins/Flow.Launcher.Plugin.Explorer/Images/file.png new file mode 100644 index 000000000..36156767a Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/Images/file.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Images/folder.png b/Plugins/Flow.Launcher.Plugin.Explorer/Images/folder.png new file mode 100644 index 000000000..569fa7049 Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/Images/folder.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs new file mode 100644 index 000000000..2be1dfd7a --- /dev/null +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Flow.Launcher.Plugin.Explorer.Search +{ + public static class Constants + { + public const string FolderImagePath = "Images\\folder.png"; + public const string FileImagePath = "Images\\file.png"; + public const string DeleteFileFolderImagePath = "Images\\deletefilefolder.png"; + public const string CopyImagePath = "Images\\copy.png"; + + public const string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory"; + } +} diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearcher.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearcher.cs index 35b4a76e2..022a70cdf 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearcher.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearcher.cs @@ -46,7 +46,9 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex { if (dataReaderResults.GetValue(0) != DBNull.Value && dataReaderResults.GetValue(1) != DBNull.Value) { - results.Add(CreateResult(dataReaderResults.GetString(0), dataReaderResults.GetString(1))); + results.Add(CreateResult(dataReaderResults.GetString(0), + dataReaderResults.GetString(1), + dataReaderResults.GetString(2))); } } } @@ -66,13 +68,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex return results; } - private Result CreateResult(string filename, string path) + private Result CreateResult(string filename, string path, string fileType) { return new Result { Title = filename, SubTitle = path, - IcoPath = "Images\\Explorer.png",//<------CHANGE + IcoPath = fileType == "Directory" ? Constants.FolderImagePath : Constants.FileImagePath, Action = c => { try diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs index 7a71c2519..d74a11b48 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs @@ -21,7 +21,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex baseQuery.QueryMaxResults = _settings.MaxResult; // Set list of columns we want to display, getting the path presently - baseQuery.QuerySelectColumns = "System.FileName, System.ItemPathDisplay"; + baseQuery.QuerySelectColumns = "System.FileName, System.ItemPathDisplay, System.ItemType"; // Filter based on file name baseQuery.QueryContentProperties = "System.FileName";