From 839eab556419b6af5046e44361bdcf14fe028d27 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 8 Feb 2012 12:56:52 -0500 Subject: Use glib-mkenums to generate enum types Rather than generating enum classes by hand (and complaining in each file that "this should really be standard"), use glib-mkenums. Unfortunately, we need a very new version of glib-mkenums in order to deal with NM's naming conventions and to fix a few other bugs, so just import that into the source tree temporarily. Also, to simplify the use of glib-mkenums, import Makefile.glib from https://bugzilla.gnome.org/654395. To avoid having to run glib-mkenums for every subdirectory of src/, add a new "generated" directory, and put the generated enums files there. Finally, use Makefile.glib for marshallers too, and generate separate ones for libnm-glib and NetworkManager. --- libnm-glib/nm-remote-settings.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'libnm-glib/nm-remote-settings.c') diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 588c120fa2..e4ed7827fb 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -25,7 +25,7 @@ #include #include -#include "nm-marshal.h" +#include "nm-glib-marshal.h" #include "nm-dbus-glib-types.h" #include "nm-remote-settings.h" #include "nm-remote-connection-private.h" @@ -102,26 +102,6 @@ nm_remote_settings_error_quark (void) return quark; } -/* This should really be standard. */ -#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } - -GType -nm_remote_settings_error_get_type (void) -{ - static GType etype = 0; - - if (etype == 0) { - static const GEnumValue values[] = { - ENUM_ENTRY (NM_REMOTE_SETTINGS_ERROR_UNKNOWN, "UnknownError"), - ENUM_ENTRY (NM_REMOTE_SETTINGS_ERROR_CONNECTION_REMOVED, "ConnectionRemoved"), - ENUM_ENTRY (NM_REMOTE_SETTINGS_ERROR_CONNECTION_UNAVAILABLE, "ConnectionUnavailable"), - { 0, 0, 0 } - }; - etype = g_enum_register_static ("NMRemoteSettingsError", values); - } - return etype; -} - /**********************************************************************/ typedef struct { @@ -812,7 +792,7 @@ constructed (GObject *object) "org.freedesktop.DBus"); g_assert (priv->dbus_proxy); - dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING_STRING, + dbus_g_object_register_marshaller (_nm_glib_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); -- cgit v1.2.1