mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
try arm 64 build
- Specify ARM64 target - Everything Search will return an error
This commit is contained in:
parent
2afebcb3f5
commit
6772f258fa
5 changed files with 33 additions and 10 deletions
|
|
@ -38,6 +38,13 @@
|
|||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM64' ">
|
||||
<DefineConstants>ARM64;$(DefineConstants)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM64' ">
|
||||
<DefineConstants>ARM64;$(DefineConstants)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Remove="App.xaml" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@
|
|||
<!-- Everything -->
|
||||
<system:String x:Key="flowlauncher_plugin_everything_sdk_issue">Failed to load Everything SDK</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_everything_is_not_running">Warning: Everything service is not running</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_everything_arm64_not_supported">ARM64 is not supported for everything.</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_everything_query_error">Error while querying Everything</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_everything_sort_by">Sort By</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_everything_sort_by_name">Name</system:String>
|
||||
|
|
|
|||
|
|
@ -42,11 +42,13 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
contextMenu = new ContextMenu(Context, Settings, viewModel);
|
||||
searchManager = new SearchManager(Settings, Context);
|
||||
ResultManager.Init(Context, Settings);
|
||||
|
||||
|
||||
SortOptionTranslationHelper.API = context.API;
|
||||
|
||||
#if !ARM64
|
||||
EverythingApiDllImport.Load(Path.Combine(Context.CurrentPluginMetadata.PluginDirectory, "EverythingSDK",
|
||||
Environment.Is64BitProcess ? "x64" : "x86"));
|
||||
#endif
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +77,7 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
IcoPath = e is EngineNotAvailableException { ErrorIcon: { } iconPath }
|
||||
? iconPath
|
||||
: Constants.GeneralSearchErrorImagePath,
|
||||
AsyncAction = e is EngineNotAvailableException {Action: { } action}
|
||||
AsyncAction = e is EngineNotAvailableException { Action: { } action }
|
||||
? action
|
||||
: _ =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,6 +20,15 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
|
|||
|
||||
private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken token = default)
|
||||
{
|
||||
#if ARM64
|
||||
throw new EngineNotAvailableException(
|
||||
Enum.GetName(Settings.IndexSearchEngineOption.Everything)!,
|
||||
"ARM64 is not supported",
|
||||
Main.Context.API.GetTranslation("flowlauncher_plugin_everything_not_support_arm64"),
|
||||
Constants.EverythingErrorImagePath,
|
||||
_ => ValueTask.FromResult(false));
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
if (!await EverythingApi.IsEverythingRunningAsync(token))
|
||||
|
|
@ -42,7 +51,9 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
|
|||
|
||||
private async ValueTask<bool> ClickToInstallEverythingAsync(ActionContext _)
|
||||
{
|
||||
var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API);
|
||||
var installedPath =
|
||||
await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath,
|
||||
Main.Context.API);
|
||||
|
||||
if (installedPath == null)
|
||||
{
|
||||
|
|
@ -57,17 +68,18 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
|
|||
return true;
|
||||
}
|
||||
|
||||
public async IAsyncEnumerable<SearchResult> SearchAsync(string search, [EnumeratorCancellation] CancellationToken token)
|
||||
public async IAsyncEnumerable<SearchResult> SearchAsync(string search,
|
||||
[EnumeratorCancellation] CancellationToken token)
|
||||
{
|
||||
await ThrowIfEverythingNotAvailableAsync(token);
|
||||
|
||||
if (token.IsCancellationRequested)
|
||||
yield break;
|
||||
|
||||
var option = new EverythingSearchOption(search,
|
||||
Settings.SortOption,
|
||||
MaxCount: Settings.MaxResult,
|
||||
IsFullPathSearch: Settings.EverythingSearchFullPath,
|
||||
var option = new EverythingSearchOption(search,
|
||||
Settings.SortOption,
|
||||
MaxCount: Settings.MaxResult,
|
||||
IsFullPathSearch: Settings.EverythingSearchFullPath,
|
||||
IsRunCounterEnabled: Settings.EverythingEnableRunCount);
|
||||
|
||||
await foreach (var result in EverythingApi.SearchAsync(option, token))
|
||||
|
|
@ -110,7 +122,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
|
|||
}
|
||||
}
|
||||
|
||||
public async IAsyncEnumerable<SearchResult> EnumerateAsync(string path, string search, bool recursive, [EnumeratorCancellation] CancellationToken token)
|
||||
public async IAsyncEnumerable<SearchResult> EnumerateAsync(string path, string search, bool recursive,
|
||||
[EnumeratorCancellation] CancellationToken token)
|
||||
{
|
||||
await ThrowIfEverythingNotAvailableAsync(token);
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
case false
|
||||
when ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword)
|
||||
|| ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword):
|
||||
|
||||
|
||||
searchResults = Settings.IndexProvider.SearchAsync(query.Search, token);
|
||||
engineName = Enum.GetName(Settings.IndexSearchEngine);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue