[gnome-builder] libide/core: rename to IdeGSettingsActionGroup
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/core: rename to IdeGSettingsActionGroup
- Date: Tue, 26 Jul 2022 19:08:30 +0000 (UTC)
commit 12f6d5ed6ecbeb6c0e15e70c573b993a3bdd1b3a
Author: Christian Hergert <chergert redhat com>
Date: Tue Jul 26 12:08:22 2022 -0700
libide/core: rename to IdeGSettingsActionGroup
I want to add GActionGroup support to IdeSettings so this would be a bit
confusing to have overlapping that class name. Keep it related to GSettings
in the type name instead.
We should totally just make GSettings implement GActionGroup upstream in
GLib at some point though.
...action-group.c => ide-gsettings-action-group.c} | 138 ++++++++++-----------
...action-group.h => ide-gsettings-action-group.h} | 8 +-
src/libide/core/libide-core.h | 2 +-
src/libide/core/meson.build | 4 +-
src/libide/gui/ide-workbench.c | 8 +-
5 files changed, 80 insertions(+), 80 deletions(-)
---
diff --git a/src/libide/core/ide-settings-action-group.c b/src/libide/core/ide-gsettings-action-group.c
similarity index 52%
rename from src/libide/core/ide-settings-action-group.c
rename to src/libide/core/ide-gsettings-action-group.c
index d9cd59280..b859089d7 100644
--- a/src/libide/core/ide-settings-action-group.c
+++ b/src/libide/core/ide-gsettings-action-group.c
@@ -1,5 +1,5 @@
/*
- * ide-settings-action-group.c
+ * ide-gsettings-action-group.c
*
* Copyright 2022 Christian Hergert <chergert redhat com>
*
@@ -19,13 +19,13 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-#define G_LOG_DOMAIN "ide-settings-action-group"
+#define G_LOG_DOMAIN "ide-gsettings-action-group"
#include "config.h"
-#include "ide-settings-action-group.h"
+#include "ide-gsettings-action-group.h"
-struct _IdeSettingsActionGroup
+struct _IdeGSettingsActionGroup
{
GObject parent_instance;
GSettings *settings;
@@ -35,7 +35,7 @@ struct _IdeSettingsActionGroup
static void action_group_iface_init (GActionGroupInterface *iface);
-G_DEFINE_FINAL_TYPE_WITH_CODE (IdeSettingsActionGroup, ide_settings_action_group, G_TYPE_OBJECT,
+G_DEFINE_FINAL_TYPE_WITH_CODE (IdeGSettingsActionGroup, ide_gsettings_action_group, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, action_group_iface_init))
enum {
@@ -47,28 +47,28 @@ enum {
static GParamSpec *properties [N_PROPS];
/**
- * ide_settings_action_group_new:
+ * ide_gsettings_action_group_new:
* @settings: a #GSettings
*
* Creates a new #GActionGroup that exports @settings.
*
- * Returns: (transfer full): an #IdeSettingsActionGroup
+ * Returns: (transfer full): an #IdeGSettingsActionGroup
*/
GActionGroup *
-ide_settings_action_group_new (GSettings *settings)
+ide_gsettings_action_group_new (GSettings *settings)
{
g_return_val_if_fail (G_IS_SETTINGS (settings), NULL);
- return g_object_new (IDE_TYPE_SETTINGS_ACTION_GROUP,
+ return g_object_new (IDE_TYPE_GSETTINGS_ACTION_GROUP,
"settings", settings,
NULL);
}
static void
-ide_settings_action_group_set_settings (IdeSettingsActionGroup *self,
- GSettings *settings)
+ide_gsettings_action_group_set_settings (IdeGSettingsActionGroup *self,
+ GSettings *settings)
{
- g_assert (IDE_IS_SETTINGS_ACTION_GROUP (self));
+ g_assert (IDE_IS_GSETTINGS_ACTION_GROUP (self));
g_assert (self->settings == NULL);
g_assert (self->schema == NULL);
g_assert (self->keys == NULL);
@@ -84,23 +84,23 @@ ide_settings_action_group_set_settings (IdeSettingsActionGroup *self,
}
static void
-ide_settings_action_group_dispose (GObject *object)
+ide_gsettings_action_group_dispose (GObject *object)
{
- IdeSettingsActionGroup *self = (IdeSettingsActionGroup *)object;
+ IdeGSettingsActionGroup *self = (IdeGSettingsActionGroup *)object;
g_clear_object (&self->settings);
g_clear_pointer (&self->schema, g_settings_schema_unref);
- G_OBJECT_CLASS (ide_settings_action_group_parent_class)->dispose (object);
+ G_OBJECT_CLASS (ide_gsettings_action_group_parent_class)->dispose (object);
}
static void
-ide_settings_action_group_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ide_gsettings_action_group_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- IdeSettingsActionGroup *self = IDE_SETTINGS_ACTION_GROUP (object);
+ IdeGSettingsActionGroup *self = IDE_GSETTINGS_ACTION_GROUP (object);
switch (prop_id)
{
@@ -114,17 +114,17 @@ ide_settings_action_group_get_property (GObject *object,
}
static void
-ide_settings_action_group_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ide_gsettings_action_group_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- IdeSettingsActionGroup *self = IDE_SETTINGS_ACTION_GROUP (object);
+ IdeGSettingsActionGroup *self = IDE_GSETTINGS_ACTION_GROUP (object);
switch (prop_id)
{
case PROP_SETTINGS:
- ide_settings_action_group_set_settings (self, g_value_get_object (value));
+ ide_gsettings_action_group_set_settings (self, g_value_get_object (value));
break;
default:
@@ -133,13 +133,13 @@ ide_settings_action_group_set_property (GObject *object,
}
static void
-ide_settings_action_group_class_init (IdeSettingsActionGroupClass *klass)
+ide_gsettings_action_group_class_init (IdeGSettingsActionGroupClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = ide_settings_action_group_dispose;
- object_class->get_property = ide_settings_action_group_get_property;
- object_class->set_property = ide_settings_action_group_set_property;
+ object_class->dispose = ide_gsettings_action_group_dispose;
+ object_class->get_property = ide_gsettings_action_group_get_property;
+ object_class->set_property = ide_gsettings_action_group_set_property;
properties [PROP_SETTINGS] =
g_param_spec_object ("settings", NULL, NULL,
@@ -150,54 +150,54 @@ ide_settings_action_group_class_init (IdeSettingsActionGroupClass *klass)
}
static void
-ide_settings_action_group_init (IdeSettingsActionGroup *self)
+ide_gsettings_action_group_init (IdeGSettingsActionGroup *self)
{
}
static gboolean
-ide_settings_action_group_has_action (GActionGroup *group,
- const char *action_name)
+ide_gsettings_action_group_has_action (GActionGroup *group,
+ const char *action_name)
{
- return g_strv_contains ((const char * const *)IDE_SETTINGS_ACTION_GROUP (group)->keys, action_name);
+ return g_strv_contains ((const char * const *)IDE_GSETTINGS_ACTION_GROUP (group)->keys, action_name);
}
static char **
-ide_settings_action_group_list_actions (GActionGroup *group)
+ide_gsettings_action_group_list_actions (GActionGroup *group)
{
- return g_strdupv (IDE_SETTINGS_ACTION_GROUP (group)->keys);
+ return g_strdupv (IDE_GSETTINGS_ACTION_GROUP (group)->keys);
}
static gboolean
-ide_settings_action_group_get_action_enabled (GActionGroup *group,
- const char *action_name)
+ide_gsettings_action_group_get_action_enabled (GActionGroup *group,
+ const char *action_name)
{
- return g_settings_is_writable (IDE_SETTINGS_ACTION_GROUP (group)->settings, action_name);
+ return g_settings_is_writable (IDE_GSETTINGS_ACTION_GROUP (group)->settings, action_name);
}
static GVariant *
-ide_settings_action_group_get_action_state (GActionGroup *group,
- const char *action_name)
+ide_gsettings_action_group_get_action_state (GActionGroup *group,
+ const char *action_name)
{
- IdeSettingsActionGroup *self = (IdeSettingsActionGroup *)group;
+ IdeGSettingsActionGroup *self = (IdeGSettingsActionGroup *)group;
return g_settings_get_value (self->settings, action_name);
}
static GVariant *
-ide_settings_action_group_get_action_state_hint (GActionGroup *group,
- const char *action_name)
+ide_gsettings_action_group_get_action_state_hint (GActionGroup *group,
+ const char *action_name)
{
- IdeSettingsActionGroup *self = (IdeSettingsActionGroup *)group;
+ IdeGSettingsActionGroup *self = (IdeGSettingsActionGroup *)group;
g_autoptr(GSettingsSchemaKey) key = g_settings_schema_get_key (self->schema, action_name);
return g_settings_schema_key_get_range (key);
}
static void
-ide_settings_action_group_change_action_state (GActionGroup *group,
- const char *action_name,
- GVariant *value)
+ide_gsettings_action_group_change_action_state (GActionGroup *group,
+ const char *action_name,
+ GVariant *value)
{
- IdeSettingsActionGroup *self = (IdeSettingsActionGroup *)group;
+ IdeGSettingsActionGroup *self = (IdeGSettingsActionGroup *)group;
g_autoptr(GSettingsSchemaKey) key = g_settings_schema_get_key (self->schema, action_name);
if (g_variant_is_of_type (value, g_settings_schema_key_get_value_type (key)) &&
@@ -211,10 +211,10 @@ ide_settings_action_group_change_action_state (GActionGroup *group,
}
static const GVariantType *
-ide_settings_action_group_get_action_state_type (GActionGroup *group,
- const char *action_name)
+ide_gsettings_action_group_get_action_state_type (GActionGroup *group,
+ const char *action_name)
{
- IdeSettingsActionGroup *self = (IdeSettingsActionGroup *)group;
+ IdeGSettingsActionGroup *self = (IdeGSettingsActionGroup *)group;
g_autoptr(GSettingsSchemaKey) key = g_settings_schema_get_key (self->schema, action_name);
g_autoptr(GVariant) default_value = g_settings_schema_key_get_default_value (key);
@@ -222,11 +222,11 @@ ide_settings_action_group_get_action_state_type (GActionGroup *group,
}
static void
-ide_settings_action_group_activate_action (GActionGroup *group,
- const char *action_name,
- GVariant *parameter)
+ide_gsettings_action_group_activate_action (GActionGroup *group,
+ const char *action_name,
+ GVariant *parameter)
{
- IdeSettingsActionGroup *self = (IdeSettingsActionGroup *)group;
+ IdeGSettingsActionGroup *self = (IdeGSettingsActionGroup *)group;
g_autoptr(GSettingsSchemaKey) key = g_settings_schema_get_key (self->schema, action_name);
g_autoptr(GVariant) default_value = g_settings_schema_key_get_default_value (key);
@@ -237,7 +237,7 @@ ide_settings_action_group_activate_action (GActionGroup *group,
if (parameter != NULL)
return;
- old = ide_settings_action_group_get_action_state (group, action_name);
+ old = ide_gsettings_action_group_get_action_state (group, action_name);
parameter = g_variant_new_boolean (!g_variant_get_boolean (old));
g_variant_unref (old);
}
@@ -246,11 +246,11 @@ ide_settings_action_group_activate_action (GActionGroup *group,
}
static const GVariantType *
-ide_settings_action_group_get_action_parameter_type (GActionGroup *group,
- const char *action_name)
+ide_gsettings_action_group_get_action_parameter_type (GActionGroup *group,
+ const char *action_name)
{
- IdeSettingsActionGroup *self = (IdeSettingsActionGroup *)group;
+ IdeGSettingsActionGroup *self = (IdeGSettingsActionGroup *)group;
g_autoptr(GSettingsSchemaKey) key = g_settings_schema_get_key (self->schema, action_name);
g_autoptr(GVariant) default_value = g_settings_schema_key_get_default_value (key);
const GVariantType *type = g_variant_get_type (default_value);
@@ -264,13 +264,13 @@ ide_settings_action_group_get_action_parameter_type (GActionGroup *group,
static void
action_group_iface_init (GActionGroupInterface *iface)
{
- iface->has_action = ide_settings_action_group_has_action;
- iface->list_actions = ide_settings_action_group_list_actions;
- iface->get_action_parameter_type = ide_settings_action_group_get_action_parameter_type;
- iface->get_action_enabled = ide_settings_action_group_get_action_enabled;
- iface->get_action_state = ide_settings_action_group_get_action_state;
- iface->get_action_state_hint = ide_settings_action_group_get_action_state_hint;
- iface->get_action_state_type = ide_settings_action_group_get_action_state_type;
- iface->change_action_state = ide_settings_action_group_change_action_state;
- iface->activate_action = ide_settings_action_group_activate_action;
+ iface->has_action = ide_gsettings_action_group_has_action;
+ iface->list_actions = ide_gsettings_action_group_list_actions;
+ iface->get_action_parameter_type = ide_gsettings_action_group_get_action_parameter_type;
+ iface->get_action_enabled = ide_gsettings_action_group_get_action_enabled;
+ iface->get_action_state = ide_gsettings_action_group_get_action_state;
+ iface->get_action_state_hint = ide_gsettings_action_group_get_action_state_hint;
+ iface->get_action_state_type = ide_gsettings_action_group_get_action_state_type;
+ iface->change_action_state = ide_gsettings_action_group_change_action_state;
+ iface->activate_action = ide_gsettings_action_group_activate_action;
}
diff --git a/src/libide/core/ide-settings-action-group.h b/src/libide/core/ide-gsettings-action-group.h
similarity index 75%
rename from src/libide/core/ide-settings-action-group.h
rename to src/libide/core/ide-gsettings-action-group.h
index c5849bf86..871f67ffe 100644
--- a/src/libide/core/ide-settings-action-group.h
+++ b/src/libide/core/ide-gsettings-action-group.h
@@ -1,5 +1,5 @@
/*
- * ide-settings-action-group.h
+ * ide-gsettings-action-group.h
*
* Copyright 2022 Christian Hergert <chergert redhat com>
*
@@ -27,12 +27,12 @@
G_BEGIN_DECLS
-#define IDE_TYPE_SETTINGS_ACTION_GROUP (ide_settings_action_group_get_type())
+#define IDE_TYPE_GSETTINGS_ACTION_GROUP (ide_gsettings_action_group_get_type())
IDE_AVAILABLE_IN_ALL
-G_DECLARE_FINAL_TYPE (IdeSettingsActionGroup, ide_settings_action_group, IDE, SETTINGS_ACTION_GROUP, GObject)
+G_DECLARE_FINAL_TYPE (IdeGSettingsActionGroup, ide_gsettings_action_group, IDE, GSETTINGS_ACTION_GROUP,
GObject)
IDE_AVAILABLE_IN_ALL
-GActionGroup *ide_settings_action_group_new (GSettings *settings);
+GActionGroup *ide_gsettings_action_group_new (GSettings *settings);
G_END_DECLS
diff --git a/src/libide/core/libide-core.h b/src/libide/core/libide-core.h
index 7d2c6d216..0f3e1450b 100644
--- a/src/libide/core/libide-core.h
+++ b/src/libide/core/libide-core.h
@@ -30,6 +30,7 @@
#include "ide-context-addin.h"
#include "ide-debug.h"
#include "ide-global.h"
+#include "ide-gsettings-action-group.h"
#include "ide-log.h"
#include "ide-macros.h"
#include "ide-notification.h"
@@ -37,7 +38,6 @@
#include "ide-object.h"
#include "ide-object-box.h"
#include "ide-settings.h"
-#include "ide-settings-action-group.h"
#include "ide-signal-group.h"
#include "ide-transfer.h"
#include "ide-transfer-manager.h"
diff --git a/src/libide/core/meson.build b/src/libide/core/meson.build
index 2af4625d4..1d8d09650 100644
--- a/src/libide/core/meson.build
+++ b/src/libide/core/meson.build
@@ -65,7 +65,7 @@ libide_core_public_headers = [
'ide-object.h',
'ide-object-box.h',
'ide-settings.h',
- 'ide-settings-action-group.h',
+ 'ide-gsettings-action-group.h',
'ide-signal-group.h',
'ide-transfer.h',
'ide-transfer-manager.h',
@@ -96,7 +96,7 @@ libide_core_public_sources = [
'ide-object-box.c',
'ide-object-notify.c',
'ide-settings.c',
- 'ide-settings-action-group.c',
+ 'ide-gsettings-action-group.c',
'ide-signal-group.c',
'ide-transfer.c',
'ide-transfer-manager.c',
diff --git a/src/libide/gui/ide-workbench.c b/src/libide/gui/ide-workbench.c
index 63b8cf65a..f19d6f878 100644
--- a/src/libide/gui/ide-workbench.c
+++ b/src/libide/gui/ide-workbench.c
@@ -762,8 +762,8 @@ static void
insert_action_groups_foreach_cb (IdeWorkspace *workspace,
gpointer user_data)
{
- g_autoptr(IdeSettingsActionGroup) project_settings_group = NULL;
- g_autoptr(IdeSettingsActionGroup) build_settings_group = NULL;
+ g_autoptr(IdeGSettingsActionGroup) project_settings_group = NULL;
+ g_autoptr(IdeGSettingsActionGroup) build_settings_group = NULL;
g_autoptr(GSettings) project_settings = NULL;
g_autoptr(GSettings) build_settings = NULL;
IdeWorkbench *self = user_data;
@@ -777,7 +777,7 @@ insert_action_groups_foreach_cb (IdeWorkspace *workspace,
add_remove_foundry_action_groups (self, workspace, TRUE);
project_settings = ide_context_ref_project_settings (self->context);
- project_settings_group = g_object_new (IDE_TYPE_SETTINGS_ACTION_GROUP,
+ project_settings_group = g_object_new (IDE_TYPE_GSETTINGS_ACTION_GROUP,
"settings", project_settings,
NULL);
gtk_widget_insert_action_group (GTK_WIDGET (workspace),
@@ -785,7 +785,7 @@ insert_action_groups_foreach_cb (IdeWorkspace *workspace,
G_ACTION_GROUP (project_settings_group));
build_settings = g_settings_new ("org.gnome.builder.build");
- build_settings_group = g_object_new (IDE_TYPE_SETTINGS_ACTION_GROUP,
+ build_settings_group = g_object_new (IDE_TYPE_GSETTINGS_ACTION_GROUP,
"settings", build_settings,
NULL);
gtk_widget_insert_action_group (GTK_WIDGET (workspace),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]