From b5e8e6d517025aec6d79e6545938b9bcca6e43e2 Mon Sep 17 00:00:00 2001 From: AliveDevil Date: Wed, 18 Dec 2024 12:03:43 +0100 Subject: [PATCH 1/2] Move autoserviceloader factory registration to shared preferences --- .../cyberduck/core/preferences/ApplicationPreferences.cs | 9 +++++++++ .../ui/core/preferences/ApplicationPreferences.cs | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/main/csharp/ch/cyberduck/core/preferences/ApplicationPreferences.cs b/core/src/main/csharp/ch/cyberduck/core/preferences/ApplicationPreferences.cs index cd43b7bfe69..a6f0429b80c 100644 --- a/core/src/main/csharp/ch/cyberduck/core/preferences/ApplicationPreferences.cs +++ b/core/src/main/csharp/ch/cyberduck/core/preferences/ApplicationPreferences.cs @@ -15,6 +15,7 @@ using ch.cyberduck.core.i18n; using ch.cyberduck.core.preferences; +using ch.cyberduck.core.serviceloader; using java.security; using java.util; using org.apache.commons.lang3; @@ -322,6 +323,14 @@ protected override void setDefaults() } } + protected override void setFactories() + { + base.setFactories(); + + this.setDefault("factory.autoserviceloader.class", + typeof(AppContextServiceLoader).AssemblyQualifiedName); + } + private static string TryToMatchLocale(string sysLocale, List appLocales) { for (int i = 0; i < appLocales.size(); i++) diff --git a/windows/src/main/csharp/ch/cyberduck/ui/core/preferences/ApplicationPreferences.cs b/windows/src/main/csharp/ch/cyberduck/ui/core/preferences/ApplicationPreferences.cs index 358b8e58b38..3598a39a711 100644 --- a/windows/src/main/csharp/ch/cyberduck/ui/core/preferences/ApplicationPreferences.cs +++ b/windows/src/main/csharp/ch/cyberduck/ui/core/preferences/ApplicationPreferences.cs @@ -57,8 +57,6 @@ protected override void setFactories() { base.setFactories(); - this.setDefault("factory.autoserviceloader.class", - typeof(AppContextServiceLoader).AssemblyQualifiedName); this.setDefault("factory.supportdirectoryfinder.class", typeof(RoamingSupportDirectoryFinder).AssemblyQualifiedName); this.setDefault("factory.localsupportdirectoryfinder.class", From 6ae823e3b93e97ebe2b01b058d5c87d3b0b91b06 Mon Sep 17 00:00:00 2001 From: AliveDevil Date: Wed, 18 Dec 2024 12:07:20 +0100 Subject: [PATCH 2/2] Set autoserviceloader in WindowsTerminalPreferences --- .../main/csharp/ch/cyberduck/cli/WindowsTerminalPreferences.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/src/main/csharp/ch/cyberduck/cli/WindowsTerminalPreferences.cs b/cli/src/main/csharp/ch/cyberduck/cli/WindowsTerminalPreferences.cs index 19772f71a6a..e4cadaf6cb6 100644 --- a/cli/src/main/csharp/ch/cyberduck/cli/WindowsTerminalPreferences.cs +++ b/cli/src/main/csharp/ch/cyberduck/cli/WindowsTerminalPreferences.cs @@ -18,6 +18,7 @@ using ch.cyberduck.cli; using ch.cyberduck.core.cryptomator; +using ch.cyberduck.core.serviceloader; using Ch.Cyberduck.Core; using Ch.Cyberduck.Core.Diagnostics; using Ch.Cyberduck.Core.Editor; @@ -68,6 +69,8 @@ protected override void setFactories() { base.setFactories(); + this.setDefault("factory.autoserviceloader.class", + typeof(AppContextServiceLoader).AssemblyQualifiedName); this.setDefault("factory.locale.class", typeof(DictionaryLocale).AssemblyQualifiedName); this.setDefault("factory.supportdirectoryfinder.class", typeof(RoamingSupportDirectoryFinder).AssemblyQualifiedName);