File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
Plugins/Flow.Launcher.Plugin.Program/Programs Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,10 @@ namespace Flow.Launcher.Plugin.Program.Programs
7
7
{
8
8
public class AppxPackageHelper
9
9
{
10
- private static readonly IAppxFactory appxFactory = ( IAppxFactory ) new AppxFactory ( ) ;
11
-
12
10
// This function returns a list of attributes of applications
13
11
public static List < IAppxManifestApplication > GetAppsFromManifest ( IStream stream )
14
12
{
13
+ IAppxFactory appxFactory = ( IAppxFactory ) new AppxFactory ( ) ;
15
14
List < IAppxManifestApplication > apps = new List < IAppxManifestApplication > ( ) ;
16
15
var reader = appxFactory . CreateManifestReader ( stream ) ;
17
16
var manifestApps = reader . GetApplications ( ) ;
Original file line number Diff line number Diff line change @@ -41,8 +41,6 @@ public UWP(Package package)
41
41
FullName = package . Id . FullName ;
42
42
FamilyName = package . Id . FamilyName ;
43
43
InitializeAppInfo ( ) ;
44
- Apps = Apps . Where ( a => ! string . IsNullOrEmpty ( a . UserModelId ) && ! string . IsNullOrEmpty ( a . DisplayName ) )
45
- . ToArray ( ) ;
46
44
}
47
45
48
46
private void InitializeAppInfo ( )
@@ -58,16 +56,13 @@ private void InitializeAppInfo()
58
56
59
57
if ( hResult == Hresult . Ok )
60
58
{
61
- var apps = new List < Application > ( ) ;
62
-
63
59
List < AppxPackageHelper . IAppxManifestApplication > _apps = AppxPackageHelper . GetAppsFromManifest ( stream ) ;
64
- foreach ( var _app in _apps )
65
- {
66
- var app = new Application ( _app , this ) ;
67
- apps . Add ( app ) ;
68
- }
69
60
70
- Apps = apps . Where ( a => a . AppListEntry != "none" ) . ToArray ( ) ;
61
+ Apps = _apps . Select ( x => new Application ( x , this ) )
62
+ . Where ( a => a . AppListEntry != "none"
63
+ && ! string . IsNullOrEmpty ( a . UserModelId )
64
+ && ! string . IsNullOrEmpty ( a . DisplayName ) )
65
+ . ToArray ( ) ;
71
66
}
72
67
else
73
68
{
You can’t perform that action at this time.
0 commit comments