summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2022-03-30 18:41:56 +0200
committerCarlos Garnacho <carlosg@gnome.org>2022-05-31 18:28:52 +0000
commit4bd1b0175120097d1e4e69d4b5279bd534c4eb62 (patch)
tree818c128bc45c4d3b3564aa822488fc879700742e /plugins
parent16f19ba8155bf5fb4618d6e42548a350367f93c4 (diff)
downloadgnome-settings-daemon-4bd1b0175120097d1e4e69d4b5279bd534c4eb62.tar.gz
xsettings: Simplify fetching string for an enum value
Diffstat (limited to 'plugins')
-rw-r--r--plugins/xsettings/fc-monitor.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/plugins/xsettings/fc-monitor.c b/plugins/xsettings/fc-monitor.c
index 63e87125..cafc8bf5 100644
--- a/plugins/xsettings/fc-monitor.c
+++ b/plugins/xsettings/fc-monitor.c
@@ -187,17 +187,6 @@ monitor_files (FcMonitor *self,
FcStrListDone (list);
}
-static const gchar *
-get_name (GType enum_type,
- gint enum_value)
-{
- GEnumClass *klass = g_type_class_ref (enum_type);
- GEnumValue *value = g_enum_get_value (klass, enum_value);
- const gchar *name = value ? value->value_name : "(unknown)";
- g_type_class_unref (klass);
- return name;
-}
-
static void
stuff_changed (GFileMonitor *monitor G_GNUC_UNUSED,
GFile *file G_GNUC_UNUSED,
@@ -206,7 +195,7 @@ stuff_changed (GFileMonitor *monitor G_GNUC_UNUSED,
gpointer data)
{
FcMonitor *self = FC_MONITOR (data);
- const gchar *event_name = get_name (G_TYPE_FILE_MONITOR_EVENT, event_type);
+ const gchar *event_name = g_enum_to_string (G_TYPE_FILE_MONITOR_EVENT, event_type);
switch (self->state) {
case UPDATE_IDLE: