From 4cbd7f32c6585c154bab3139a44f79ca4e842cf6 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Tue, 30 Dec 2025 00:41:25 +0800 Subject: [PATCH] Simplify logic --- .../Search/WindowsIndex/QueryConstructor.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs index 702741590..def63f347 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs @@ -112,15 +112,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex return null; var typesList = allowedResultTypes as IList ?? allowedResultTypes.ToList(); - - // No filtering needed if empty or all types are allowed - // TODO: what if more types are added in the future? - if (typesList.Count == 0 || typesList.Count == 3) - return null; - var hasFile = typesList.Contains(ResultType.File); var hasFolder = typesList.Contains(ResultType.Folder) || typesList.Contains(ResultType.Volume); // Folder and volume are merged in Folder action keyword so treat them as same + // No filtering needed if empty or all types are allowed + if (hasFile && hasFolder || !hasFile && !hasFolder) + return null; + if (hasFolder) return "System.ItemType = '.directory'";