diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 3ccffd45a..544b74abe 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -23,6 +23,10 @@ namespace Flow.Launcher.Plugin.Explorer contextMenus.Add(CreateOpenContainingFolderResult(record)); } + if (record.ShowIndexState) + contextMenus.Add(new Result { Title = "Indexed: " + (record.WindowsIndexed ? "Yes" : "No"), + Score = 501, IcoPath = Constants.IndexImagePath }); + var icoPath = (record.Type == ResultType.File) ? Constants.FileImagePath : Constants.FolderImagePath; var fileOrFolder = (record.Type == ResultType.File) ? "file" : "folder"; contextMenus.Add(new Result 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 0261da36b..3f3206567 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,10 @@ PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Images/index.png b/Plugins/Flow.Launcher.Plugin.Explorer/Images/index.png new file mode 100644 index 000000000..c63fc8069 Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/Images/index.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs index 2be1dfd7a..17070fbc1 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs @@ -10,6 +10,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search public const string FileImagePath = "Images\\file.png"; public const string DeleteFileFolderImagePath = "Images\\deletefilefolder.png"; public const string CopyImagePath = "Images\\copy.png"; + public const string IndexImagePath = "Images\\index.png"; public const string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory"; } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/DirectoryInfo/DirectoryInfoSearch.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/DirectoryInfo/DirectoryInfoSearch.cs index 31697aa95..0faae15b5 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/DirectoryInfo/DirectoryInfoSearch.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/DirectoryInfo/DirectoryInfoSearch.cs @@ -71,11 +71,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo if (fileSystemInfo is System.IO.DirectoryInfo) { - folderList.Add(ResultManager.CreateFolderResult(fileSystemInfo.Name, fileSystemInfo.FullName, fileSystemInfo.FullName, query)); + folderList.Add(ResultManager.CreateFolderResult(fileSystemInfo.Name, fileSystemInfo.FullName, fileSystemInfo.FullName, query, true, false)); } else { - fileList.Add(ResultManager.CreateFileResult(fileSystemInfo.FullName, query)); + fileList.Add(ResultManager.CreateFileResult(fileSystemInfo.FullName, query, true, false)); } } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index ef392f920..50791251f 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -11,7 +11,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search { internal static class ResultManager { - internal static Result CreateFolderResult(string title, string subtitle, string path, Query query) + internal static Result CreateFolderResult(string title, string subtitle, string path, Query query, bool showIndexState = false, bool windowsIndexed = false) { return new Result { @@ -41,7 +41,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search query.ActionKeyword + " " + changeTo); return false; }, - ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path } + ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path, ShowIndexState = showIndexState, WindowsIndexed = windowsIndexed } }; } @@ -85,7 +85,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search }; } - internal static Result CreateFileResult(string filePath, Query query) + internal static Result CreateFileResult(string filePath, Query query, bool showIndexState = false, bool windowsIndexed = false) { var result = new Result { @@ -106,7 +106,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return true; }, - ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath } + ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath, ShowIndexState = showIndexState, WindowsIndexed = windowsIndexed } }; return result; } @@ -116,6 +116,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search { public string FullPath { get; set; } public ResultType Type { get; set; } + + public bool WindowsIndexed { get; set; } + + public bool ShowIndexState { get; set; } } internal enum ResultType diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs index 4f0f8439a..c2513820b 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs @@ -71,10 +71,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex private Result CreateResult(string filename, string path, string fileType, Query query) { if (fileType == "Directory") - return ResultManager.CreateFolderResult(filename, path, path, query); + return ResultManager.CreateFolderResult(filename, path, path, query, true, true); else { - return ResultManager.CreateFileResult(path, query); + return ResultManager.CreateFileResult(path, query, true, true); } }