mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Revert "Improving performance of Adding and Removing Packaged Apps" (#4898)
* Revert "Adding newline to end of file for IProgramRepository" This reverts commitd55cac80bf. * Revert "Fixing comments" This reverts commita1ecdc9bfa. * Revert "Restoring checks for invalid uwp apps based on PR feedback. This was accidentally removed when moving the initialize outside the constructor." This reverts commit0e8c1cb0fd. * Revert "Removing unecessary implementation of IRepository interface as this is implemented by the base class." This reverts commit1c724280f5. * Revert "Fixing potential race condition in ListRepository. Now internally implemented as a concurrent dictionary." This reverts commit9ff8246a9d. * Revert "Updating packagerepository comment based on pr feedback" This reverts commit2c45956030. * Revert "Changing test structure. Need to add unit tests." This reverts commit1c267a55d5. * Revert "Fixing message format for exception" This reverts commitf60bdc3dd4. * Revert "Merging in Theme changes and moving win32Tests to Microsoft.Plugin.Program.UnitTests" This reverts commit030dfc2370.
This commit is contained in:
committed by
GitHub
parent
b13e719ab3
commit
12d9d59d85
@@ -61,6 +61,20 @@ namespace Microsoft.Plugin.Program.Views.Commands
|
||||
Enabled = t1.Enabled
|
||||
}
|
||||
));
|
||||
|
||||
Main._uwps
|
||||
.Where(t1 => !ProgramSetting.ProgramSettingDisplayList.Any(x => x.UniqueIdentifier == t1.UniqueIdentifier))
|
||||
.ToList()
|
||||
.ForEach(t1 => ProgramSetting.ProgramSettingDisplayList
|
||||
.Add(
|
||||
new ProgramSource
|
||||
{
|
||||
Name = t1.DisplayName,
|
||||
Location = t1.Package.Location,
|
||||
UniqueIdentifier = t1.UniqueIdentifier,
|
||||
Enabled = t1.Enabled
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
internal static void SetProgramSourcesStatus(this List<ProgramSource> list, List<ProgramSource> selectedProgramSourcesToDisable, bool status)
|
||||
@@ -74,6 +88,11 @@ namespace Microsoft.Plugin.Program.Views.Commands
|
||||
.Where(t1 => selectedProgramSourcesToDisable.Any(x => x.UniqueIdentifier == t1.UniqueIdentifier && t1.Enabled != status))
|
||||
.ToList()
|
||||
.ForEach(t1 => t1.Enabled = status);
|
||||
|
||||
Main._uwps
|
||||
.Where(t1 => selectedProgramSourcesToDisable.Any(x => x.UniqueIdentifier == t1.UniqueIdentifier && t1.Enabled != status))
|
||||
.ToList()
|
||||
.ForEach(t1 => t1.Enabled = status);
|
||||
}
|
||||
|
||||
internal static void StoreDisabledInSettings(this List<ProgramSource> list)
|
||||
@@ -114,7 +133,7 @@ namespace Microsoft.Plugin.Program.Views.Commands
|
||||
|
||||
internal static bool IsReindexRequired(this List<ProgramSource> selectedItems)
|
||||
{
|
||||
if (selectedItems.Where(t1 => t1.Enabled).Count() > 0
|
||||
if (selectedItems.Where(t1 => t1.Enabled && !Main._uwps.Any(x => t1.UniqueIdentifier == x.UniqueIdentifier)).Count() > 0
|
||||
&& selectedItems.Where(t1 => t1.Enabled && !Main._win32s.Any(x => t1.UniqueIdentifier == x.UniqueIdentifier)).Count() > 0)
|
||||
return true;
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace Microsoft.Plugin.Program.Views
|
||||
Task.Run(() =>
|
||||
{
|
||||
Dispatcher.Invoke(() => { indexingPanel.Visibility = Visibility.Visible; });
|
||||
Main.IndexPrograms();
|
||||
Dispatcher.Invoke(() => { indexingPanel.Visibility = Visibility.Hidden; });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user