mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Slightly speed up uwp index
This commit is contained in:
parent
cdde5fae2e
commit
1e8cc9afb5
2 changed files with 6 additions and 12 deletions
|
|
@ -7,11 +7,10 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
{
|
||||
public class AppxPackageHelper
|
||||
{
|
||||
private static readonly IAppxFactory appxFactory = (IAppxFactory)new AppxFactory();
|
||||
|
||||
// This function returns a list of attributes of applications
|
||||
public static List<IAppxManifestApplication> GetAppsFromManifest(IStream stream)
|
||||
{
|
||||
IAppxFactory appxFactory = (IAppxFactory)new AppxFactory();
|
||||
List<IAppxManifestApplication> apps = new List<IAppxManifestApplication>();
|
||||
var reader = appxFactory.CreateManifestReader(stream);
|
||||
var manifestApps = reader.GetApplications();
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
FullName = package.Id.FullName;
|
||||
FamilyName = package.Id.FamilyName;
|
||||
InitializeAppInfo();
|
||||
Apps = Apps.Where(a => !string.IsNullOrEmpty(a.UserModelId) && !string.IsNullOrEmpty(a.DisplayName))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private void InitializeAppInfo()
|
||||
|
|
@ -58,16 +56,13 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
|
||||
if (hResult == Hresult.Ok)
|
||||
{
|
||||
var apps = new List<Application>();
|
||||
|
||||
List<AppxPackageHelper.IAppxManifestApplication> _apps = AppxPackageHelper.GetAppsFromManifest(stream);
|
||||
foreach (var _app in _apps)
|
||||
{
|
||||
var app = new Application(_app, this);
|
||||
apps.Add(app);
|
||||
}
|
||||
|
||||
Apps = apps.Where(a => a.AppListEntry != "none").ToArray();
|
||||
Apps = _apps.Select(x => new Application(x, this))
|
||||
.Where(a => a.AppListEntry != "none"
|
||||
&& !string.IsNullOrEmpty(a.UserModelId)
|
||||
&& !string.IsNullOrEmpty(a.DisplayName))
|
||||
.ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue