diff options
Diffstat (limited to 'src/settings/nm-agent-manager.c')
| -rw-r--r-- | src/settings/nm-agent-manager.c | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c index 5ccbdc67..b7057400 100644 --- a/src/settings/nm-agent-manager.c +++ b/src/settings/nm-agent-manager.c @@ -36,6 +36,7 @@ #include "nm-manager-auth.h" #include "nm-setting-vpn.h" #include "nm-setting-connection.h" +#include "nm-enum-types.h" G_DEFINE_TYPE (NMAgentManager, nm_agent_manager, G_TYPE_OBJECT) @@ -88,17 +89,6 @@ static void impl_agent_manager_unregister (NMAgentManager *self, /********************************************************************/ #define NM_AGENT_MANAGER_ERROR (nm_agent_manager_error_quark ()) -#define NM_TYPE_AGENT_MANAGER_ERROR (nm_agent_manager_error_get_type ()) - -typedef enum { - NM_AGENT_MANAGER_ERROR_SENDER_UNKNOWN = 0, - NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED, - NM_AGENT_MANAGER_ERROR_SESSION_NOT_FOUND, - NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER, - NM_AGENT_MANAGER_ERROR_NOT_REGISTERED, - NM_AGENT_MANAGER_ERROR_INTERNAL_ERROR, - NM_AGENT_MANAGER_ERROR_NO_SECRETS -} NMAgentManagerError; static GQuark nm_agent_manager_error_quark (void) @@ -110,37 +100,6 @@ nm_agent_manager_error_quark (void) return ret; } -#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } - -static GType -nm_agent_manager_error_get_type (void) -{ - static GType etype = 0; - - if (etype == 0) { - static const GEnumValue values[] = { - /* Unable to determine caller's sender or UID */ - ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_SENDER_UNKNOWN, "SenderUnknown"), - /* Permission for some operation was denied */ - ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED, "PermissionDenied"), - /* The caller's session could not be determined */ - ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_SESSION_NOT_FOUND, "SessionNotFound"), - /* The identifier was invalid */ - ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER, "InvalidIdentifier"), - /* Request was not from a registered agent */ - ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_NOT_REGISTERED, "NotRegistered"), - /* Some internal error occurred */ - ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_INTERNAL_ERROR, "InternalError"), - /* No secrets were available */ - ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_NO_SECRETS, "NoSecrets"), - { 0, 0, 0 } - }; - - etype = g_enum_register_static ("NMAgentManagerError", values); - } - return etype; -} - /*************************************************************/ static gboolean @@ -962,7 +921,7 @@ get_next_cb (Request *req) * we use the 'modify.own' permission instead of 'modify.system'. If the * request affects more than just the caller, require 'modify.system'. */ - s_con = (NMSettingConnection *) nm_connection_get_setting (req->connection, NM_TYPE_SETTING_CONNECTION); + s_con = nm_connection_get_setting_connection (req->connection); g_assert (s_con); if (nm_setting_connection_get_num_permissions (s_con) == 1) perm = NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN; |