switch to using TrimmedQuery

This commit is contained in:
Jeremy 2026-01-01 22:45:52 +11:00
parent f9df44a2cd
commit 6d6003fd80
4 changed files with 9 additions and 9 deletions

View file

@ -259,7 +259,7 @@ namespace Flow.Launcher
await PluginManager.InitializePluginsAsync(_mainVM);
_mainVM.RefreshLastOpenedHistoryResult();
_mainVM.RefreshLastOpenedHistoryResults();
// Refresh home page after plugins are initialized because users may open main window during plugin initialization
// And home page is created without full plugin list

View file

@ -13,7 +13,7 @@ public class LastOpenedHistoryResult : Result
public LastOpenedHistoryResult()
{
this.OriginQuery = new Query { RawQuery = Query };
this.OriginQuery = new Query { TrimmedQuery = Query };
}
public LastOpenedHistoryResult(Result result)
@ -21,7 +21,7 @@ public class LastOpenedHistoryResult : Result
Title = result.Title;
SubTitle = result.SubTitle;
PluginID = result.PluginID;
Query = result.OriginQuery.RawQuery;
Query = result.OriginQuery.TrimmedQuery;
OriginQuery = result.OriginQuery;
RecordKey = result.RecordKey;
IcoPath = result.IcoPath;
@ -32,10 +32,10 @@ public class LastOpenedHistoryResult : Result
Action = _ =>
{
App.API.BackToQueryResults();
App.API.ChangeQuery(result.OriginQuery.RawQuery);
App.API.ChangeQuery(result.OriginQuery.TrimmedQuery);
return false;
};
//Used for last history style reopening, currently need to be assigned at MainViewModel.cs
//Used for Last Opened History style reopening, currently need to be assigned at MainViewModel.cs
AsyncAction = null;
}
@ -66,13 +66,13 @@ public class LastOpenedHistoryResult : Result
return Title == r.Title
&& SubTitle == r.SubTitle
&& PluginID == r.PluginID
&& Query == r.OriginQuery.RawQuery;
&& Query == r.OriginQuery.TrimmedQuery;
}
else
{
return RecordKey == r.RecordKey
&& PluginID == r.PluginID
&& Query == r.OriginQuery.RawQuery;
&& Query == r.OriginQuery.TrimmedQuery;
}
}
}

View file

@ -30,7 +30,7 @@ namespace Flow.Launcher.Storage
{
Title = Localize.executeQuery(item.Query),
IcoPath = Constant.HistoryIcon,
OriginQuery = new Query { RawQuery = item.Query },
OriginQuery = new Query { TrimmedQuery = item.Query },
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uE81C"),
Query = item.Query,
Action = _ =>

View file

@ -1367,7 +1367,7 @@ namespace Flow.Launcher.ViewModel
/// TODO COMMENT- Requires the plugins to have initialized first because
/// it needs the plugin directory paths for initialization
/// </summary>
internal void RefreshLastOpenedHistoryResult()
internal void RefreshLastOpenedHistoryResults()
{
_history.PopulateHistoryFromLegacyHistory();
_history.UpdateIcoPathAbsolute();