diff options
author | Gary Kramlich <grim@reaperworld.com> | 2022-10-10 02:30:03 -0500 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2022-10-10 02:30:03 -0500 |
commit | e1762daf23571a1d613535475c5b70b5376a77f7 (patch) | |
tree | 5736da8b3abe5b68fc773c51b6dc10e3e52313c3 /libpurple/tests | |
parent | 123e4b523cae989f3128ec1e69cf72950ca812f2 (diff) | |
download | pidgin-e1762daf23571a1d613535475c5b70b5376a77f7.tar.gz |
Add a get_settings_backend vfunc to CoreUiOps
This allows the user interface to declare their own settings backend. There's
some minor duplication between finch and pidgin for this, but this means the
test ui can use a memory backend instead of something on disk.
Testing Done:
Ran the unit tests multiple times and verified that the credential manager test stops messing up everything else.
Reviewed at https://reviews.imfreedom.org/r/1921/
Diffstat (limited to 'libpurple/tests')
-rw-r--r-- | libpurple/tests/test_ui.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libpurple/tests/test_ui.c b/libpurple/tests/test_ui.c index 6b3131cd51..f172462678 100644 --- a/libpurple/tests/test_ui.c +++ b/libpurple/tests/test_ui.c @@ -26,6 +26,9 @@ #include <glib.h> #include <glib/gprintf.h> +#define G_SETTINGS_ENABLE_BACKEND +#include <gio/gsettingsbackend.h> + #include <signal.h> #include <string.h> #ifdef _WIN32 @@ -61,8 +64,14 @@ test_ui_init(void) purple_conversations_set_ui_ops(&test_conv_uiops); } +static gpointer +test_ui_get_settings_backend(void) { + return g_memory_settings_backend_new(); +} + static PurpleCoreUiOps test_core_uiops = { - .ui_init = test_ui_init + .ui_init = test_ui_init, + .get_settings_backend = test_ui_get_settings_backend, }; static gboolean |