--- a/libpurple/data/im.pidgin.Purple.gschema.xml Sun Sep 11 00:33:00 2022 -0500
+++ b/libpurple/data/im.pidgin.Purple.gschema.xml Sun Sep 11 00:34:53 2022 -0500
@@ -1,5 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<schema path="/" id="im.pidgin.Purple">
+ <child name="credentials" schema="im.pidgin.Purple.Credentials"/> + <schema path="/purple/credentials/" id="im.pidgin.Purple.Credentials"> + <key name="active-provider" type="s"> + <default>"noop-provider"</default> + <summary>Active credential provider</summary> + The credential provider that will be used to save credentials, i.e., + passwords, tokens, etc. --- a/libpurple/purplecredentialmanager.c Sun Sep 11 00:33:00 2022 -0500
+++ b/libpurple/purplecredentialmanager.c Sun Sep 11 00:34:53 2022 -0500
@@ -128,10 +128,14 @@
PurpleCredentialManager *manager = PURPLE_CREDENTIAL_MANAGER(data);
if(!PURPLE_IS_CREDENTIAL_PROVIDER(manager->active)) {
+ GSettings *settings = NULL; - const gchar *id = NULL;
- id = purple_prefs_get_string("/purple/credentials/active-provider");
+ settings = g_settings_new_with_backend("im.pidgin.Purple.Credentials", + purple_core_get_settings_backend()); + id = g_settings_get_string(settings, "active-provider"); + g_object_unref(settings); if(!purple_credential_manager_set_active(manager, id, &error)) {
g_warning("Failed to make %s the active credential provider : %s",
@@ -145,6 +149,7 @@
@@ -247,11 +252,6 @@
PURPLE_TYPE_CREDENTIAL_PROVIDER,
PURPLE_TYPE_CREDENTIAL_PROVIDER);
- /* Add our purple preferences. */
- purple_prefs_add_none("/purple/credentials");
- purple_prefs_add_string("/purple/credentials/active-provider",
/******************************************************************************
@@ -354,13 +354,19 @@
* If it is, go ahead and make it the active provider.
if(!PURPLE_IS_CREDENTIAL_PROVIDER(manager->active)) {
- const gchar *wanted = NULL;
+ GSettings *settings = NULL; - wanted = purple_prefs_get_string("/purple/credentials/active-provider");
+ settings = g_settings_new_with_backend("im.pidgin.Purple.Credentials", + purple_core_get_settings_backend()); + wanted = g_settings_get_string(settings, "active-provider"); if(purple_strequal(wanted, id)) {
purple_credential_manager_set_active(manager, id, error);
+ g_object_unref(settings); @@ -438,7 +444,12 @@
/* Finally update the preference. */
- purple_prefs_set_string("/purple/credentials/active-provider", id);
+ GSettings *settings = NULL; + settings = g_settings_new_with_backend("im.pidgin.Purple.Credentials", + purple_core_get_settings_backend()); + g_settings_set_string(settings, "active-provider", id); + g_object_unref(settings); purple_debug_info("credential-manager", "set active provider to '%s'", id);