mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
chore: lock lists in plugin manager when sorting
This commit is contained in:
parent
379a4422a2
commit
aa58edec9a
1 changed files with 19 additions and 10 deletions
|
|
@ -46,6 +46,8 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
private readonly DateTime timeLoaded;
|
private readonly DateTime timeLoaded;
|
||||||
|
|
||||||
|
private readonly object listLock = new();
|
||||||
|
|
||||||
#region Image Tester State
|
#region Image Tester State
|
||||||
|
|
||||||
private string[] testerImagePaths = new string[5];
|
private string[] testerImagePaths = new string[5];
|
||||||
|
|
@ -431,7 +433,8 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
this.sortKind = selectable.SortKind;
|
this.sortKind = selectable.SortKind;
|
||||||
this.filterText = selectable.Localization;
|
this.filterText = selectable.Localization;
|
||||||
|
|
||||||
this.ResortPlugins();
|
lock(this.listLock)
|
||||||
|
this.ResortPlugins();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2684,11 +2687,14 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
{
|
{
|
||||||
var pluginManager = Service<PluginManager>.Get();
|
var pluginManager = Service<PluginManager>.Get();
|
||||||
|
|
||||||
// By removing installed plugins only when the available plugin list changes (basically when the window is
|
lock (this.listLock)
|
||||||
// opened), plugins that have been newly installed remain in the available plugin list as installed.
|
{
|
||||||
this.pluginListAvailable = pluginManager.AvailablePlugins.ToList();
|
// By removing installed plugins only when the available plugin list changes (basically when the window is
|
||||||
this.pluginListUpdatable = pluginManager.UpdatablePlugins.ToList();
|
// opened), plugins that have been newly installed remain in the available plugin list as installed.
|
||||||
this.ResortPlugins();
|
this.pluginListAvailable = pluginManager.AvailablePlugins.ToList();
|
||||||
|
this.pluginListUpdatable = pluginManager.UpdatablePlugins.ToList();
|
||||||
|
this.ResortPlugins();
|
||||||
|
}
|
||||||
|
|
||||||
this.UpdateCategoriesOnPluginsChange();
|
this.UpdateCategoriesOnPluginsChange();
|
||||||
}
|
}
|
||||||
|
|
@ -2697,10 +2703,13 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
{
|
{
|
||||||
var pluginManager = Service<PluginManager>.Get();
|
var pluginManager = Service<PluginManager>.Get();
|
||||||
|
|
||||||
this.pluginListInstalled = pluginManager.InstalledPlugins.ToList();
|
lock (this.listLock)
|
||||||
this.pluginListUpdatable = pluginManager.UpdatablePlugins.ToList();
|
{
|
||||||
this.hasDevPlugins = this.pluginListInstalled.Any(plugin => plugin.IsDev);
|
this.pluginListInstalled = pluginManager.InstalledPlugins.ToList();
|
||||||
this.ResortPlugins();
|
this.pluginListUpdatable = pluginManager.UpdatablePlugins.ToList();
|
||||||
|
this.hasDevPlugins = this.pluginListInstalled.Any(plugin => plugin.IsDev);
|
||||||
|
this.ResortPlugins();
|
||||||
|
}
|
||||||
|
|
||||||
this.UpdateCategoriesOnPluginsChange();
|
this.UpdateCategoriesOnPluginsChange();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue