[gnome-builder/wip/gtk4-port: 932/1774] libide/gui: cleanup preference window addin loading
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 932/1774] libide/gui: cleanup preference window addin loading
- Date: Mon, 11 Jul 2022 22:31:28 +0000 (UTC)
commit da42c5421314ee40a7a347de8d1ba85d01c9f898
Author: Christian Hergert <chergert redhat com>
Date: Mon May 9 15:19:58 2022 -0700
libide/gui: cleanup preference window addin loading
src/libide/gui/ide-preferences-window.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/src/libide/gui/ide-preferences-window.c b/src/libide/gui/ide-preferences-window.c
index 0626fda74..4f76bdf37 100644
--- a/src/libide/gui/ide-preferences-window.c
+++ b/src/libide/gui/ide-preferences-window.c
@@ -327,35 +327,26 @@ ide_preferences_window_extension_removed (IdeExtensionSetAdapter *set,
static void
ide_preferences_window_load_addins (IdePreferencesWindow *self)
{
+ IdeContext *context = NULL;
+ const char *kind = "application";
+
g_assert (IDE_IS_PREFERENCES_WINDOW (self));
g_assert (self->addins == NULL);
_ide_preferences_builtin_register (self);
- if (self->mode == IDE_PREFERENCES_MODE_APPLICATION)
- {
- self->addins = ide_extension_set_adapter_new (NULL,
- peas_engine_get_default (),
- IDE_TYPE_PREFERENCES_ADDIN,
- "Preferences-Kind", "application");
- }
- else if (self->mode == IDE_PREFERENCES_MODE_PROJECT)
+ if (self->mode == IDE_PREFERENCES_MODE_PROJECT)
{
IdeWorkbench *workbench = IDE_WORKBENCH (gtk_window_get_group (GTK_WINDOW (self)));
- IdeContext *context = ide_workbench_get_context (workbench);
-
- self->addins = ide_extension_set_adapter_new (IDE_OBJECT (context),
- peas_engine_get_default (),
- IDE_TYPE_PREFERENCES_ADDIN,
- "Preferences-Kind", "project");
- /* TODO: This also needs configurations, but that could be under a page
- * if we wanted to.
- */
+ context = ide_workbench_get_context (workbench);
+ kind = "project";
}
- if (self->addins == NULL)
- return;
+ self->addins = ide_extension_set_adapter_new (IDE_OBJECT (context),
+ peas_engine_get_default (),
+ IDE_TYPE_PREFERENCES_ADDIN,
+ "Preferences-Kind", kind);
g_signal_connect (self->addins,
"extension-added",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]