mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
is equals
This commit is contained in:
parent
0131b92c7a
commit
ced824d791
1 changed files with 15 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flow.Launcher.Core.Plugin;
|
||||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using Flow.Launcher.Plugin;
|
||||
using Flow.Launcher.Storage;
|
||||
|
||||
|
|
@ -41,4 +42,18 @@ public static class ResultHelper
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsEquals(this Result result, LastOpenedHistoryItem item, HistoryStyle style)
|
||||
{
|
||||
bool keyMatches = string.IsNullOrEmpty(result.RecordKey)
|
||||
? item.Title == result.Title
|
||||
: item.RecordKey == result.RecordKey;
|
||||
|
||||
bool queryMatches = style != HistoryStyle.Query || item.Query == result.OriginQuery.RawQuery;
|
||||
|
||||
return keyMatches
|
||||
&& queryMatches
|
||||
&& item.PluginID == result.PluginID
|
||||
&& item.HistoryStyle == style;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue