From 4bd1b0175120097d1e4e69d4b5279bd534c4eb62 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 30 Mar 2022 18:41:56 +0200 Subject: xsettings: Simplify fetching string for an enum value --- plugins/xsettings/fc-monitor.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'plugins') 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: -- cgit v1.2.1