remove unnecessary show Windows index state in context menu option

This commit is contained in:
Jeremy 2022-12-05 07:06:20 +11:00
parent e1c4ee0208
commit 797464d356
4 changed files with 5 additions and 20 deletions

View file

@ -54,15 +54,6 @@ namespace Flow.Launcher.Plugin.Explorer
contextMenus.Add(CreateOpenWindowsIndexingOptions());
}
if (record.ShowIndexState)
contextMenus.Add(new Result
{
Title = "From index search: " + (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";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -42,14 +42,14 @@ namespace Flow.Launcher.Plugin.Explorer.Search
return result.Type switch
{
ResultType.Folder or ResultType.Volume => CreateFolderResult(Path.GetFileName(result.FullPath),
result.FullPath, result.FullPath, query, 0, result.ShowIndexState, result.WindowsIndexed),
result.FullPath, result.FullPath, query, 0, result.WindowsIndexed),
ResultType.File => CreateFileResult(
result.FullPath, query, 0, result.ShowIndexState, result.WindowsIndexed),
result.FullPath, query, 0, result.WindowsIndexed),
_ => throw new ArgumentOutOfRangeException()
};
}
internal static Result CreateFolderResult(string title, string subtitle, string path, Query query, int score = 0, bool showIndexState = false, bool windowsIndexed = false)
internal static Result CreateFolderResult(string title, string subtitle, string path, Query query, int score = 0, bool windowsIndexed = false)
{
return new Result
{
@ -85,7 +85,6 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{
Type = ResultType.Folder,
FullPath = path,
ShowIndexState = showIndexState,
WindowsIndexed = windowsIndexed
}
};
@ -126,7 +125,6 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{
Type = ResultType.Volume,
FullPath = path,
ShowIndexState = true,
WindowsIndexed = windowsIndexed
}
};
@ -200,13 +198,12 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{
Type = ResultType.Folder,
FullPath = path,
ShowIndexState = true,
WindowsIndexed = windowsIndexed
}
};
}
internal static Result CreateFileResult(string filePath, Query query, int score = 0, bool showIndexState = false, bool windowsIndexed = false)
internal static Result CreateFileResult(string filePath, Query query, int score = 0, bool windowsIndexed = false)
{
var result = new Result
{
@ -261,7 +258,6 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{
Type = ResultType.File,
FullPath = filePath,
ShowIndexState = showIndexState,
WindowsIndexed = windowsIndexed
}
};

View file

@ -1,4 +1,4 @@
using System;
using System;
namespace Flow.Launcher.Plugin.Explorer.Search
{
@ -9,7 +9,5 @@ namespace Flow.Launcher.Plugin.Explorer.Search
public int Score { get; init; }
public bool WindowsIndexed { get; init; }
public bool ShowIndexState { get; init; }
}
}