mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Update disable logic and add unique identifier for programs
This commit is contained in:
@@ -160,7 +160,14 @@ namespace Wox.Plugin.Program.Programs
|
||||
}
|
||||
return u.Apps;
|
||||
}).ToArray();
|
||||
return applications;
|
||||
|
||||
var updatedListWithoutDisabledApps = applications
|
||||
.Where(t1 => !Main._settings.ProgramSources
|
||||
.Any(x => !x.Enabled
|
||||
&& x.UniqueIdentifier == t1.UniqueIdentifier))
|
||||
.Select(x => x);
|
||||
|
||||
return updatedListWithoutDisabledApps.ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -202,20 +209,6 @@ namespace Wox.Plugin.Program.Programs
|
||||
}
|
||||
}
|
||||
|
||||
public static Application[] RetainApplications(Application[] applications, List<Settings.ProgramSource> applicationsToRetainPaths, bool enableProgramSourceOnly)
|
||||
{
|
||||
if(enableProgramSourceOnly)
|
||||
return applications
|
||||
.Where(t1 => applicationsToRetainPaths
|
||||
.Any(x => x.Location == t1.Package.Location
|
||||
&& x.Enabled))
|
||||
.Select(t1 => t1).ToArray();
|
||||
|
||||
// Do not return if the application is disabled for indexing
|
||||
return applications.Where(t1 => !applicationsToRetainPaths.Any(x => x.Location == t1.Package.Location && !x.Enabled))
|
||||
.Select(t1 => t1).ToArray();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return FamilyName;
|
||||
@@ -243,6 +236,7 @@ namespace Wox.Plugin.Program.Programs
|
||||
public class Application : IProgram
|
||||
{
|
||||
public string AppListEntry { get; set; }
|
||||
public string UniqueIdentifier { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string UserModelId { get; set; }
|
||||
@@ -337,6 +331,7 @@ namespace Wox.Plugin.Program.Programs
|
||||
public Application(IAppxManifestApplication manifestApp, UWP package)
|
||||
{
|
||||
UserModelId = manifestApp.GetAppUserModelId();
|
||||
UniqueIdentifier = manifestApp.GetAppUserModelId();
|
||||
DisplayName = manifestApp.GetStringValue("DisplayName");
|
||||
Description = manifestApp.GetStringValue("Description");
|
||||
BackgroundColor = manifestApp.GetStringValue("BackgroundColor");
|
||||
|
||||
Reference in New Issue
Block a user