diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 544b74abe..ab9c8f10f 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -20,12 +20,14 @@ namespace Flow.Launcher.Plugin.Explorer if (record.Type == ResultType.File) { contextMenus.Add(CreateOpenWithEditorResult(record)); - contextMenus.Add(CreateOpenContainingFolderResult(record)); } + contextMenus.Add(CreateOpenContainingFolderResult(record)); + if (record.ShowIndexState) - contextMenus.Add(new Result { Title = "Indexed: " + (record.WindowsIndexed ? "Yes" : "No"), - Score = 501, IcoPath = Constants.IndexImagePath }); + contextMenus.Add(new Result {Title = "Indexed: " + (record.WindowsIndexed ? "Yes" : "No"), + SubTitle = "Location: " + record.FullPath, + Score = 501, IcoPath = Constants.IndexImagePath}); var icoPath = (record.Type == ResultType.File) ? Constants.FileImagePath : Constants.FolderImagePath; var fileOrFolder = (record.Type == ResultType.File) ? "file" : "folder"; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index ec9c793ac..d9035ea9d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -45,7 +45,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search }; } - internal static Result CreateOpenCurrentFolderResult(string path, bool isPreviousDirectoryLevel) + internal static Result CreateOpenCurrentFolderResult(string path, bool isPreviousDirectoryLevel, bool windowsIndexed = false) { var folderName = path; @@ -81,7 +81,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search { FilesFolders.OpenPath(path); return true; - } + }, + ContextData = new SearchResult { Type = ResultType.Folder, FullPath = folderName, ShowIndexState = true, WindowsIndexed = windowsIndexed } }; } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 7bc038900..d6dec77d2 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -48,7 +48,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search var results = new List(); - var currentFolderResult = CreateOpenCurrentFolderResult(FilesFolders.LocationExists, querySearch); + var currentFolderResult = CreateOpenCurrentFolderResult(FilesFolders.LocationExists, querySearch, WindowsIndexExists(querySearch)); if (currentFolderResult == null) return new List(); @@ -113,17 +113,17 @@ namespace Flow.Launcher.Plugin.Explorer.Search return _indexSearch.PathIsIndexed(path); } - private Result CreateOpenCurrentFolderResult(Func locationExists, string querySearchString) + private Result CreateOpenCurrentFolderResult(Func locationExists, string querySearchString, bool indexExists) { if (locationExists(querySearchString)) - return ResultManager.CreateOpenCurrentFolderResult(querySearchString, false); + return ResultManager.CreateOpenCurrentFolderResult(querySearchString, false, indexExists); var previousDirectoryPath = FilesFolders.GetPreviousExistingDirectory(FilesFolders.LocationExists, querySearchString); if (string.IsNullOrEmpty(previousDirectoryPath)) return null; - return ResultManager.CreateOpenCurrentFolderResult(previousDirectoryPath, true); + return ResultManager.CreateOpenCurrentFolderResult(previousDirectoryPath, true, indexExists); } } }