[gnome-builder] plugins/valgrind: use settings schema auto loading
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/valgrind: use settings schema auto loading
- Date: Wed, 27 Jul 2022 06:15:30 +0000 (UTC)
commit 6b5a47466e3a0f70087cead6ff46a406f6aa602d
Author: Christian Hergert <chergert redhat com>
Date: Tue Jul 26 23:14:42 2022 -0700
plugins/valgrind: use settings schema auto loading
We can also drop the workbench addin now because we don't need it just to
register GSettings on the window.
src/plugins/valgrind/gbp-valgrind-tool.c | 18 +--
.../valgrind/gbp-valgrind-workbench-addin.c | 144 ---------------------
.../valgrind/gbp-valgrind-workbench-addin.h | 31 -----
src/plugins/valgrind/meson.build | 1 -
.../org.gnome.builder.valgrind.gschema.xml | 2 +-
src/plugins/valgrind/valgrind-plugin.c | 4 -
src/plugins/valgrind/valgrind.plugin | 1 +
7 files changed, 12 insertions(+), 189 deletions(-)
---
diff --git a/src/plugins/valgrind/gbp-valgrind-tool.c b/src/plugins/valgrind/gbp-valgrind-tool.c
index 62c48ae97..5c77584bd 100644
--- a/src/plugins/valgrind/gbp-valgrind-tool.c
+++ b/src/plugins/valgrind/gbp-valgrind-tool.c
@@ -44,10 +44,11 @@ gbp_valgrind_tool_handler_cb (IdeRunContext *run_context,
GError **error)
{
GbpValgrindTool *self = user_data;
- g_autoptr(GSettings) settings = NULL;
+ g_autoptr(IdeSettings) settings = NULL;
g_autoptr(GString) leak_kinds = NULL;
g_autofree char *name = NULL;
g_autofree char *leak_check = NULL;
+ IdeContext *context;
gboolean track_origins;
int source_fd;
int dest_fd;
@@ -61,7 +62,8 @@ gbp_valgrind_tool_handler_cb (IdeRunContext *run_context,
g_assert (env != NULL);
g_assert (GBP_IS_VALGRIND_TOOL (self));
- settings = g_settings_new ("org.gnome.builder.valgrind");
+ context = ide_object_get_context (IDE_OBJECT (self));
+ settings = ide_context_ref_settings (context, "org.gnome.builder.valgrind");
if (cwd != NULL)
ide_run_context_set_cwd (run_context, cwd);
@@ -81,17 +83,17 @@ gbp_valgrind_tool_handler_cb (IdeRunContext *run_context,
ide_set_string (&self->log_name, name);
g_debug ("Using %s for valgrind log", name);
- track_origins = g_settings_get_boolean (settings, "track-origins");
- leak_check = g_settings_get_string (settings, "leak-check");
+ track_origins = ide_settings_get_boolean (settings, "track-origins");
+ leak_check = ide_settings_get_string (settings, "leak-check");
leak_kinds = g_string_new (NULL);
- if (g_settings_get_boolean (settings, "leak-kind-definite"))
+ if (ide_settings_get_boolean (settings, "leak-kind-definite"))
g_string_append (leak_kinds, "definite,");
- if (g_settings_get_boolean (settings, "leak-kind-possible"))
+ if (ide_settings_get_boolean (settings, "leak-kind-possible"))
g_string_append (leak_kinds, "possible,");
- if (g_settings_get_boolean (settings, "leak-kind-indirect"))
+ if (ide_settings_get_boolean (settings, "leak-kind-indirect"))
g_string_append (leak_kinds, "indirect,");
- if (g_settings_get_boolean (settings, "leak-kind-reachable"))
+ if (ide_settings_get_boolean (settings, "leak-kind-reachable"))
g_string_append (leak_kinds, "reachable,");
ide_run_context_append_argv (run_context, "valgrind");
diff --git a/src/plugins/valgrind/meson.build b/src/plugins/valgrind/meson.build
index 132ba5616..b32e788d1 100644
--- a/src/plugins/valgrind/meson.build
+++ b/src/plugins/valgrind/meson.build
@@ -3,7 +3,6 @@ if get_option('plugin_valgrind')
plugins_sources += files([
'valgrind-plugin.c',
'gbp-valgrind-tool.c',
- 'gbp-valgrind-workbench-addin.c',
])
plugin_valgrind_resources = gnome.compile_resources(
diff --git a/src/plugins/valgrind/org.gnome.builder.valgrind.gschema.xml
b/src/plugins/valgrind/org.gnome.builder.valgrind.gschema.xml
index fe9eb0387..27a4ca41e 100644
--- a/src/plugins/valgrind/org.gnome.builder.valgrind.gschema.xml
+++ b/src/plugins/valgrind/org.gnome.builder.valgrind.gschema.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
- <schema id="org.gnome.builder.valgrind" path="/org/gnome/builder/valgrind/" gettext-domain="gnome-builder">
+ <schema id="org.gnome.builder.valgrind" gettext-domain="gnome-builder">
<key name="leak-kind-definite" type="b">
<default>true</default>
</key>
diff --git a/src/plugins/valgrind/valgrind-plugin.c b/src/plugins/valgrind/valgrind-plugin.c
index b3df73279..bc798e63d 100644
--- a/src/plugins/valgrind/valgrind-plugin.c
+++ b/src/plugins/valgrind/valgrind-plugin.c
@@ -27,7 +27,6 @@
#include <libide-gui.h>
#include "gbp-valgrind-tool.h"
-#include "gbp-valgrind-workbench-addin.h"
_IDE_EXTERN void
_gbp_valgrind_register_types (PeasObjectModule *module)
@@ -35,7 +34,4 @@ _gbp_valgrind_register_types (PeasObjectModule *module)
peas_object_module_register_extension_type (module,
IDE_TYPE_RUN_TOOL,
GBP_TYPE_VALGRIND_TOOL);
- peas_object_module_register_extension_type (module,
- IDE_TYPE_WORKBENCH_ADDIN,
- GBP_TYPE_VALGRIND_WORKBENCH_ADDIN);
}
diff --git a/src/plugins/valgrind/valgrind.plugin b/src/plugins/valgrind/valgrind.plugin
index 3b1faa29f..7b389a653 100644
--- a/src/plugins/valgrind/valgrind.plugin
+++ b/src/plugins/valgrind/valgrind.plugin
@@ -8,3 +8,4 @@ Embedded=_gbp_valgrind_register_types
Module=valgrind
Name=Leak Detector
X-Category=debuggers
+X-Settings-Schemas=org.gnome.builder.valgrind;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]