diff --git a/docs/libnm-glib/Makefile.am b/docs/libnm-glib/Makefile.am index cb077140d6..66826cb8af 100644 --- a/docs/libnm-glib/Makefile.am +++ b/docs/libnm-glib/Makefile.am @@ -45,7 +45,7 @@ IGNORE_HFILES= \ nm-device-wifi-bindings.h \ nm-dhcp4-config-bindings.h \ nm-dhcp6-config-bindings.h \ - nm-sysconfig-connection-glue.h \ + nm-settings-connection-glue.h \ nm-ip4-config-bindings.h \ nm-ip6-config-bindings.h \ nm-settings-bindings.h \ diff --git a/introspection/Makefile.am b/introspection/Makefile.am index 42640e3020..8b4302b211 100644 --- a/introspection/Makefile.am +++ b/introspection/Makefile.am @@ -18,7 +18,7 @@ EXTRA_DIST = \ nm-manager.xml \ nm-manager-client.xml \ nm-settings.xml \ - nm-sysconfig-connection.xml \ + nm-settings-connection.xml \ nm-vpn-plugin.xml \ nm-vpn-connection.xml \ nm-ppp-manager.xml \ diff --git a/introspection/all.xml b/introspection/all.xml index fb2b749e8b..edb22dc516 100644 --- a/introspection/all.xml +++ b/introspection/all.xml @@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - + diff --git a/introspection/nm-sysconfig-connection.xml b/introspection/nm-settings-connection.xml similarity index 95% rename from introspection/nm-sysconfig-connection.xml rename to introspection/nm-settings-connection.xml index 2d53d65ceb..82e53451cd 100644 --- a/introspection/nm-sysconfig-connection.xml +++ b/introspection/nm-settings-connection.xml @@ -14,7 +14,7 @@ update request, and will be either stored in persistent storage or given to a Secret Agent for storage, depending on the request. - + @@ -27,7 +27,7 @@ Delete the connection. - + @@ -38,7 +38,7 @@ to the network, as those are often protected. Secrets must be requested separately using the GetSecrets() call. - + @@ -54,7 +54,7 @@ the requestor's session will be returned. The user will never be prompted for secrets as a result of this request. - + diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 856dc89d98..b6949781be 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -12,7 +12,7 @@ BUILT_SOURCES = \ nm-device-ethernet-bindings.h \ nm-device-wifi-bindings.h \ nm-device-bt-bindings.h \ - nm-sysconfig-connection-bindings.h \ + nm-settings-connection-bindings.h \ nm-device-wimax-bindings.h \ nm-settings-bindings.h \ nm-vpn-connection-bindings.h \ @@ -198,8 +198,8 @@ nm-access-point-bindings.h: $(top_srcdir)/introspection/nm-access-point.xml nm-settings-bindings.h: $(top_srcdir)/introspection/nm-settings.xml $(AM_V_GEN) dbus-binding-tool --prefix=nm_settings --mode=glib-client --output=$@ $< -nm-sysconfig-connection-bindings.h: $(top_srcdir)/introspection/nm-sysconfig-connection.xml - $(AM_V_GEN) dbus-binding-tool --prefix=nm_sysconfig_connection --mode=glib-client --output=$@ $< +nm-settings-connection-bindings.h: $(top_srcdir)/introspection/nm-settings-connection.xml + $(AM_V_GEN) dbus-binding-tool --prefix=nm_settings_connection --mode=glib-client --output=$@ $< nm-vpn-connection-bindings.h: $(top_srcdir)/introspection/nm-vpn-connection.xml $(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-client --output=$@ $< diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c index 8b7e575969..b07c42945f 100644 --- a/libnm-glib/nm-remote-connection.c +++ b/libnm-glib/nm-remote-connection.c @@ -29,7 +29,7 @@ #include "nm-remote-connection.h" #include "nm-remote-connection-private.h" #include "nm-dbus-glib-types.h" -#include "nm-sysconfig-connection-bindings.h" +#include "nm-settings-connection-bindings.h" #define NM_REMOTE_CONNECTION_BUS "bus" diff --git a/src/nm-agent-manager.c b/src/nm-agent-manager.c index 46c6144399..b4b776e328 100644 --- a/src/nm-agent-manager.c +++ b/src/nm-agent-manager.c @@ -31,7 +31,7 @@ #include "nm-agent-manager.h" #include "nm-secret-agent.h" #include "nm-manager-auth.h" -#include "nm-sysconfig-connection.h" +#include "nm-settings-connection.h" #include "nm-dbus-glib-types.h" G_DEFINE_TYPE (NMAgentManager, nm_agent_manager, G_TYPE_OBJECT) @@ -571,9 +571,9 @@ request_start_secrets (gpointer user_data) req, req->setting_name); /* Grab any secrets from persistent storage */ - secrets = nm_sysconfig_connection_get_secrets (NM_SYSCONFIG_CONNECTION (req->connection), - req->setting_name, - &error); + secrets = nm_settings_connection_get_secrets (NM_SETTINGS_CONNECTION (req->connection), + req->setting_name, + &error); if (secrets) setting_secrets = g_hash_table_lookup (secrets, req->setting_name); @@ -795,7 +795,7 @@ nm_agent_manager_get_secrets (NMAgentManager *self, g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (connection != NULL, 0); - g_return_val_if_fail (NM_IS_SYSCONFIG_CONNECTION (connection), 0); + g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), 0); g_return_val_if_fail (callback != NULL, 0); nm_log_dbg (LOGD_SETTINGS, diff --git a/src/nm-manager.c b/src/nm-manager.c index 2247b35573..2f8cbdf4a4 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -57,7 +57,7 @@ #include "nm-bluez-manager.h" #include "nm-bluez-common.h" #include "nm-settings.h" -#include "nm-sysconfig-connection.h" +#include "nm-settings-connection.h" #include "nm-manager-auth.h" #include "nm-agent-manager.h" #include "NetworkManagerUtils.h" @@ -480,7 +480,7 @@ nm_manager_update_state (NMManager *manager) } static void -ignore_cb (NMSysconfigConnection *connection, GError *error, gpointer user_data) +ignore_cb (NMSettingsConnection *connection, GError *error, gpointer user_data) { } @@ -509,7 +509,7 @@ update_active_connection_timestamp (NMManager *manager, NMDevice *device) if (nm_setting_connection_get_read_only (s_con)) return; - nm_sysconfig_connection_commit_changes (NM_SYSCONFIG_CONNECTION (connection), ignore_cb, NULL); + nm_settings_connection_commit_changes (NM_SETTINGS_CONNECTION (connection), ignore_cb, NULL); } static void @@ -918,7 +918,7 @@ get_active_connections (NMManager *manager, NMConnection *filter) static void connections_changed (NMSettings *settings, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, NMManager *manager) { bluez_manager_resync_devices (manager); @@ -1995,7 +1995,7 @@ static void pending_activate (NMManager *self, PendingActivation *pending) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); - NMSysconfigConnection *connection; + NMSettingsConnection *connection; const char *path = NULL; GError *error = NULL; @@ -2069,7 +2069,7 @@ impl_manager_activate_connection (NMManager *self, static void activation_add_done (NMSettings *self, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, GError *error, DBusGMethodInvocation *context, gpointer user_data) @@ -3097,13 +3097,13 @@ nm_manager_get (NMSettings *settings, G_CALLBACK (system_unmanaged_devices_changed_cb), singleton); g_signal_connect (priv->settings, "notify::" NM_SETTINGS_HOSTNAME, G_CALLBACK (system_hostname_changed_cb), singleton); - g_signal_connect (priv->settings, NM_SETTINGS_CONNECTION_ADDED, + g_signal_connect (priv->settings, NM_SETTINGS_SIGNAL_CONNECTION_ADDED, G_CALLBACK (connections_changed), singleton); - g_signal_connect (priv->settings, NM_SETTINGS_CONNECTION_UPDATED, + g_signal_connect (priv->settings, NM_SETTINGS_SIGNAL_CONNECTION_UPDATED, G_CALLBACK (connections_changed), singleton); - g_signal_connect (priv->settings, NM_SETTINGS_CONNECTION_REMOVED, + g_signal_connect (priv->settings, NM_SETTINGS_SIGNAL_CONNECTION_REMOVED, G_CALLBACK (connections_changed), singleton); - g_signal_connect (priv->settings, NM_SETTINGS_CONNECTION_VISIBILITY_CHANGED, + g_signal_connect (priv->settings, NM_SETTINGS_SIGNAL_CONNECTION_VISIBILITY_CHANGED, G_CALLBACK (connections_changed), singleton); dbus_g_connection_register_g_object (bus, NM_DBUS_PATH, G_OBJECT (singleton)); diff --git a/src/nm-policy.c b/src/nm-policy.c index d31a2dd0b8..23fc6ac736 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -741,7 +741,7 @@ auto_activate_device (gpointer user_data) /* Ignore connections that aren't visible to any logged-in users */ if (ignore == FALSE) { - if (!nm_sysconfig_connection_is_visible (NM_SYSCONFIG_CONNECTION (candidate))) + if (!nm_settings_connection_is_visible (NM_SETTINGS_CONNECTION (candidate))) ignore = TRUE; } @@ -1099,12 +1099,12 @@ connection_removed (NMSettings *settings, static void connection_visibility_changed (NMSettings *settings, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, gpointer user_data) { NMPolicy *policy = user_data; - if (nm_sysconfig_connection_is_visible (connection)) + if (nm_settings_connection_is_visible (connection)) schedule_activate_all (policy); else _deactivate_if_active (policy->manager, NM_CONNECTION (connection)); @@ -1169,11 +1169,11 @@ nm_policy_new (NMManager *manager, _connect_manager_signal (policy, "device-added", device_added); _connect_manager_signal (policy, "device-removed", device_removed); - _connect_settings_signal (policy, NM_SETTINGS_CONNECTIONS_LOADED, connections_loaded); - _connect_settings_signal (policy, NM_SETTINGS_CONNECTION_ADDED, connection_added); - _connect_settings_signal (policy, NM_SETTINGS_CONNECTION_UPDATED, connection_updated); - _connect_settings_signal (policy, NM_SETTINGS_CONNECTION_REMOVED, connection_removed); - _connect_settings_signal (policy, NM_SETTINGS_CONNECTION_VISIBILITY_CHANGED, + _connect_settings_signal (policy, NM_SETTINGS_SIGNAL_CONNECTIONS_LOADED, connections_loaded); + _connect_settings_signal (policy, NM_SETTINGS_SIGNAL_CONNECTION_ADDED, connection_added); + _connect_settings_signal (policy, NM_SETTINGS_SIGNAL_CONNECTION_UPDATED, connection_updated); + _connect_settings_signal (policy, NM_SETTINGS_SIGNAL_CONNECTION_REMOVED, connection_removed); + _connect_settings_signal (policy, NM_SETTINGS_SIGNAL_CONNECTION_VISIBILITY_CHANGED, connection_visibility_changed); initialized = TRUE; diff --git a/src/settings/Makefile.am b/src/settings/Makefile.am index 927169cc27..ddb2e5a0a7 100644 --- a/src/settings/Makefile.am +++ b/src/settings/Makefile.am @@ -9,7 +9,7 @@ noinst_LTLIBRARIES = libsettings.la BUILT_SOURCES = \ nm-settings-glue.h \ - nm-sysconfig-connection-glue.h + nm-settings-connection-glue.h libsettings_la_SOURCES = \ nm-settings.c \ @@ -21,8 +21,8 @@ libsettings_la_SOURCES = \ nm-settings-error.h \ nm-system-config-interface.c \ nm-system-config-interface.h \ - nm-sysconfig-connection.c \ - nm-sysconfig-connection.h \ + nm-settings-connection.c \ + nm-settings-connection.h \ nm-default-wired-connection.c \ nm-default-wired-connection.h @@ -56,8 +56,8 @@ libsettings_la_LDFLAGS = -rdynamic nm-settings-glue.h: $(top_srcdir)/introspection/nm-settings.xml $(AM_V_GEN) dbus-binding-tool --prefix=nm_settings --mode=glib-server --output=$@ $< -nm-sysconfig-connection-glue.h: $(top_srcdir)/introspection/nm-sysconfig-connection.xml - $(AM_V_GEN) dbus-binding-tool --prefix=nm_sysconfig_connection --mode=glib-server --output=$@ $< +nm-settings-connection-glue.h: $(top_srcdir)/introspection/nm-settings-connection.xml + $(AM_V_GEN) dbus-binding-tool --prefix=nm_settings_connection --mode=glib-server --output=$@ $< CLEANFILES = \ $(BUILT_SOURCES) diff --git a/src/settings/nm-default-wired-connection.c b/src/settings/nm-default-wired-connection.c index 63683480e2..e8b9a1554a 100644 --- a/src/settings/nm-default-wired-connection.c +++ b/src/settings/nm-default-wired-connection.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * (C) Copyright 2008 Novell, Inc. - * (C) Copyright 2009 Red Hat, Inc. + * (C) Copyright 2009 - 2011 Red Hat, Inc. */ #include @@ -32,7 +32,7 @@ #include "nm-marshal.h" #include "nm-default-wired-connection.h" -G_DEFINE_TYPE (NMDefaultWiredConnection, nm_default_wired_connection, NM_TYPE_SYSCONFIG_CONNECTION) +G_DEFINE_TYPE (NMDefaultWiredConnection, nm_default_wired_connection, NM_TYPE_SETTINGS_CONNECTION) #define NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnectionPrivate)) @@ -85,8 +85,8 @@ nm_default_wired_connection_get_device (NMDefaultWiredConnection *wired) } static void -commit_changes (NMSysconfigConnection *connection, - NMSysconfigConnectionCommitFunc callback, +commit_changes (NMSettingsConnection *connection, + NMSettingsConnectionCommitFunc callback, gpointer user_data) { NMDefaultWiredConnection *self = NM_DEFAULT_WIRED_CONNECTION (connection); @@ -101,17 +101,17 @@ commit_changes (NMSysconfigConnection *connection, } static void -do_delete (NMSysconfigConnection *connection, - NMSysconfigConnectionDeleteFunc callback, +do_delete (NMSettingsConnection *connection, + NMSettingsConnectionDeleteFunc callback, gpointer user_data) { NMDefaultWiredConnection *self = NM_DEFAULT_WIRED_CONNECTION (connection); NMDefaultWiredConnectionPrivate *priv = NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (connection); g_signal_emit (self, signals[DELETED], 0, priv->mac); - NM_SYSCONFIG_CONNECTION_CLASS (nm_default_wired_connection_parent_class)->delete (connection, - callback, - user_data); + NM_SETTINGS_CONNECTION_CLASS (nm_default_wired_connection_parent_class)->delete (connection, + callback, + user_data); } /****************************************************************/ @@ -237,7 +237,7 @@ static void nm_default_wired_connection_class_init (NMDefaultWiredConnectionClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - NMSysconfigConnectionClass *sysconfig_class = NM_SYSCONFIG_CONNECTION_CLASS (klass); + NMSettingsConnectionClass *settings_class = NM_SETTINGS_CONNECTION_CLASS (klass); g_type_class_add_private (klass, sizeof (NMDefaultWiredConnectionPrivate)); @@ -246,8 +246,8 @@ nm_default_wired_connection_class_init (NMDefaultWiredConnectionClass *klass) object_class->set_property = set_property; object_class->get_property = get_property; object_class->finalize = finalize; - sysconfig_class->commit_changes = commit_changes; - sysconfig_class->delete = do_delete; + settings_class->commit_changes = commit_changes; + settings_class->delete = do_delete; /* Properties */ g_object_class_install_property diff --git a/src/settings/nm-default-wired-connection.h b/src/settings/nm-default-wired-connection.h index de89b67567..9a3bafd027 100644 --- a/src/settings/nm-default-wired-connection.h +++ b/src/settings/nm-default-wired-connection.h @@ -16,13 +16,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * (C) Copyright 2008 Novell, Inc. - * (C) Copyright 2009 Red Hat, Inc. + * (C) Copyright 2009 - 2011 Red Hat, Inc. */ #ifndef NM_DEFAULT_WIRED_CONNECTION_H #define NM_DEFAULT_WIRED_CONNECTION_H -#include "nm-sysconfig-connection.h" +#include "nm-settings-connection.h" #include "nm-device.h" G_BEGIN_DECLS @@ -39,11 +39,11 @@ G_BEGIN_DECLS #define NM_DEFAULT_WIRED_CONNECTION_READ_ONLY "read-only" typedef struct { - NMSysconfigConnection parent; + NMSettingsConnection parent; } NMDefaultWiredConnection; typedef struct { - NMSysconfigConnectionClass parent; + NMSettingsConnectionClass parent; } NMDefaultWiredConnectionClass; GType nm_default_wired_connection_get_type (void); diff --git a/src/settings/nm-sysconfig-connection.c b/src/settings/nm-settings-connection.c similarity index 70% rename from src/settings/nm-sysconfig-connection.c rename to src/settings/nm-settings-connection.c index 40823562a1..5977ebad64 100644 --- a/src/settings/nm-sysconfig-connection.c +++ b/src/settings/nm-settings-connection.c @@ -26,7 +26,7 @@ #include #include -#include "nm-sysconfig-connection.h" +#include "nm-settings-connection.h" #include "nm-session-monitor.h" #include "nm-dbus-manager.h" #include "nm-settings-error.h" @@ -35,27 +35,27 @@ #include "nm-logging.h" #include "nm-manager-auth.h" -static void impl_sysconfig_connection_get_settings (NMSysconfigConnection *connection, - DBusGMethodInvocation *context); - -static void impl_sysconfig_connection_update (NMSysconfigConnection *connection, - GHashTable *new_settings, - DBusGMethodInvocation *context); - -static void impl_sysconfig_connection_delete (NMSysconfigConnection *connection, - DBusGMethodInvocation *context); - -static void impl_sysconfig_connection_get_secrets (NMSysconfigConnection *connection, - const gchar *setting_name, +static void impl_settings_connection_get_settings (NMSettingsConnection *connection, DBusGMethodInvocation *context); -#include "nm-sysconfig-connection-glue.h" +static void impl_settings_connection_update (NMSettingsConnection *connection, + GHashTable *new_settings, + DBusGMethodInvocation *context); -G_DEFINE_TYPE (NMSysconfigConnection, nm_sysconfig_connection, NM_TYPE_CONNECTION) +static void impl_settings_connection_delete (NMSettingsConnection *connection, + DBusGMethodInvocation *context); -#define NM_SYSCONFIG_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - NM_TYPE_SYSCONFIG_CONNECTION, \ - NMSysconfigConnectionPrivate)) +static void impl_settings_connection_get_secrets (NMSettingsConnection *connection, + const gchar *setting_name, + DBusGMethodInvocation *context); + +#include "nm-settings-connection-glue.h" + +G_DEFINE_TYPE (NMSettingsConnection, nm_settings_connection, NM_TYPE_CONNECTION) + +#define NM_SETTINGS_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_SETTINGS_CONNECTION, \ + NMSettingsConnectionPrivate)) enum { PROP_0 = 0, @@ -77,7 +77,7 @@ typedef struct { NMSessionMonitor *session_monitor; guint session_changed_id; -} NMSysconfigConnectionPrivate; +} NMSettingsConnectionPrivate; /**************************************************************/ @@ -113,37 +113,36 @@ perm_to_user (const char *perm, char *out_user, gsize out_user_size) /**************************************************************/ static void -set_visible (NMSysconfigConnection *self, gboolean new_visible) +set_visible (NMSettingsConnection *self, gboolean new_visible) { - NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); if (new_visible == priv->visible) return; priv->visible = new_visible; - g_object_notify (G_OBJECT (self), NM_SYSCONFIG_CONNECTION_VISIBLE); + g_object_notify (G_OBJECT (self), NM_SETTINGS_CONNECTION_VISIBLE); } gboolean -nm_sysconfig_connection_is_visible (NMSysconfigConnection *self) +nm_settings_connection_is_visible (NMSettingsConnection *self) { - g_return_val_if_fail (NM_SYSCONFIG_CONNECTION (self), FALSE); + g_return_val_if_fail (NM_SETTINGS_CONNECTION (self), FALSE); - return NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self)->visible; + return NM_SETTINGS_CONNECTION_GET_PRIVATE (self)->visible; } void -nm_sysconfig_connection_recheck_visibility (NMSysconfigConnection *self) +nm_settings_connection_recheck_visibility (NMSettingsConnection *self) { - NMSysconfigConnectionPrivate *priv; + NMSettingsConnectionPrivate *priv; NMSettingConnection *s_con; guint32 num, i; - g_return_if_fail (NM_SYSCONFIG_CONNECTION (self)); + g_return_if_fail (NM_SETTINGS_CONNECTION (self)); - priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); - s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (NM_CONNECTION (self), - NM_TYPE_SETTING_CONNECTION)); + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (self), NM_TYPE_SETTING_CONNECTION); g_assert (s_con); /* Check every user in the ACL for a session */ @@ -174,7 +173,7 @@ nm_sysconfig_connection_recheck_visibility (NMSysconfigConnection *self) static void session_changed_cb (NMSessionMonitor *self, gpointer user_data) { - nm_sysconfig_connection_recheck_visibility (NM_SYSCONFIG_CONNECTION (user_data)); + nm_settings_connection_recheck_visibility (NM_SETTINGS_CONNECTION (user_data)); } /**************************************************************/ @@ -182,20 +181,20 @@ session_changed_cb (NMSessionMonitor *self, gpointer user_data) /* Update the settings of this connection to match that of 'new', taking care to * make a private copy of secrets. */ gboolean -nm_sysconfig_connection_replace_settings (NMSysconfigConnection *self, - NMConnection *new, - GError **error) +nm_settings_connection_replace_settings (NMSettingsConnection *self, + NMConnection *new, + GError **error) { - NMSysconfigConnectionPrivate *priv; + NMSettingsConnectionPrivate *priv; GHashTable *new_settings; gboolean success = FALSE; g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (NM_IS_SYSCONFIG_CONNECTION (self), FALSE); + g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE); g_return_val_if_fail (new != NULL, FALSE); g_return_val_if_fail (NM_IS_CONNECTION (new), FALSE); - priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); new_settings = nm_connection_to_hash (new); g_assert (new_settings); @@ -207,7 +206,7 @@ nm_sysconfig_connection_replace_settings (NMSysconfigConnection *self, g_object_unref (priv->secrets); priv->secrets = nm_connection_duplicate (NM_CONNECTION (self)); - nm_sysconfig_connection_recheck_visibility (self); + nm_settings_connection_recheck_visibility (self); success = TRUE; } g_hash_table_destroy (new_settings); @@ -215,7 +214,7 @@ nm_sysconfig_connection_replace_settings (NMSysconfigConnection *self, } static void -ignore_cb (NMSysconfigConnection *connection, +ignore_cb (NMSettingsConnection *connection, GError *error, gpointer user_data) { @@ -227,15 +226,15 @@ ignore_cb (NMSysconfigConnection *connection, * 'user_data' along with any errors encountered. */ void -nm_sysconfig_connection_replace_and_commit (NMSysconfigConnection *self, - NMConnection *new, - NMSysconfigConnectionCommitFunc callback, - gpointer user_data) +nm_settings_connection_replace_and_commit (NMSettingsConnection *self, + NMConnection *new, + NMSettingsConnectionCommitFunc callback, + gpointer user_data) { GError *error = NULL; g_return_if_fail (self != NULL); - g_return_if_fail (NM_IS_SYSCONFIG_CONNECTION (self)); + g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self)); g_return_if_fail (new != NULL); g_return_if_fail (NM_IS_CONNECTION (new)); @@ -246,12 +245,12 @@ nm_sysconfig_connection_replace_and_commit (NMSysconfigConnection *self, if (nm_connection_compare (NM_CONNECTION (self), NM_CONNECTION (new), NM_SETTING_COMPARE_FLAG_EXACT)) { - callback (self, NULL, user_data); - return; + callback (self, NULL, user_data); + return; } - if (nm_sysconfig_connection_replace_settings (self, new, &error)) { - nm_sysconfig_connection_commit_changes (self, callback, user_data); + if (nm_settings_connection_replace_settings (self, new, &error)) { + nm_settings_connection_commit_changes (self, callback, user_data); } else { callback (self, error, user_data); g_clear_error (&error); @@ -259,18 +258,18 @@ nm_sysconfig_connection_replace_and_commit (NMSysconfigConnection *self, } void -nm_sysconfig_connection_commit_changes (NMSysconfigConnection *connection, - NMSysconfigConnectionCommitFunc callback, - gpointer user_data) +nm_settings_connection_commit_changes (NMSettingsConnection *connection, + NMSettingsConnectionCommitFunc callback, + gpointer user_data) { g_return_if_fail (connection != NULL); - g_return_if_fail (NM_IS_SYSCONFIG_CONNECTION (connection)); + g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection)); g_return_if_fail (callback != NULL); - if (NM_SYSCONFIG_CONNECTION_GET_CLASS (connection)->commit_changes) { - NM_SYSCONFIG_CONNECTION_GET_CLASS (connection)->commit_changes (connection, - callback, - user_data); + if (NM_SETTINGS_CONNECTION_GET_CLASS (connection)->commit_changes) { + NM_SETTINGS_CONNECTION_GET_CLASS (connection)->commit_changes (connection, + callback, + user_data); } else { GError *error = g_error_new (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INTERNAL_ERROR, @@ -281,18 +280,18 @@ nm_sysconfig_connection_commit_changes (NMSysconfigConnection *connection, } void -nm_sysconfig_connection_delete (NMSysconfigConnection *connection, - NMSysconfigConnectionDeleteFunc callback, - gpointer user_data) +nm_settings_connection_delete (NMSettingsConnection *connection, + NMSettingsConnectionDeleteFunc callback, + gpointer user_data) { g_return_if_fail (connection != NULL); - g_return_if_fail (NM_IS_SYSCONFIG_CONNECTION (connection)); + g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection)); g_return_if_fail (callback != NULL); - if (NM_SYSCONFIG_CONNECTION_GET_CLASS (connection)->delete) { - NM_SYSCONFIG_CONNECTION_GET_CLASS (connection)->delete (connection, - callback, - user_data); + if (NM_SETTINGS_CONNECTION_GET_CLASS (connection)->delete) { + NM_SETTINGS_CONNECTION_GET_CLASS (connection)->delete (connection, + callback, + user_data); } else { GError *error = g_error_new (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INTERNAL_ERROR, @@ -303,8 +302,8 @@ nm_sysconfig_connection_delete (NMSysconfigConnection *connection, } static void -commit_changes (NMSysconfigConnection *connection, - NMSysconfigConnectionCommitFunc callback, +commit_changes (NMSettingsConnection *connection, + NMSettingsConnectionCommitFunc callback, gpointer user_data) { g_object_ref (connection); @@ -314,9 +313,9 @@ commit_changes (NMSysconfigConnection *connection, } static void -do_delete (NMSysconfigConnection *connection, - NMSysconfigConnectionDeleteFunc callback, - gpointer user_data) +do_delete (NMSettingsConnection *connection, + NMSettingsConnectionDeleteFunc callback, + gpointer user_data) { g_object_ref (connection); set_visible (connection, FALSE); @@ -328,7 +327,7 @@ do_delete (NMSysconfigConnection *connection, /**************************************************************/ static gboolean -supports_secrets (NMSysconfigConnection *connection, const char *setting_name) +supports_secrets (NMSettingsConnection *connection, const char *setting_name) { /* All secrets supported */ return TRUE; @@ -409,8 +408,8 @@ destroy_gvalue (gpointer data) } /** - * nm_sysconfig_connection_get_secrets: - * @connection: the #NMSysconfigConnection + * nm_settings_connection_get_secrets: + * @connection: the #NMSettingsConnection * @setting_name: the setting to return secrets for * @error: an error on return, if an error occured * @@ -418,11 +417,11 @@ destroy_gvalue (gpointer data) * Agents for secrets. **/ GHashTable * -nm_sysconfig_connection_get_secrets (NMSysconfigConnection *connection, - const char *setting_name, - GError **error) +nm_settings_connection_get_secrets (NMSettingsConnection *connection, + const char *setting_name, + GError **error) { - NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (connection); + NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (connection); GHashTable *settings = NULL; GHashTable *secrets = NULL; NMSetting *setting; @@ -430,7 +429,7 @@ nm_sysconfig_connection_get_secrets (NMSysconfigConnection *connection, /* Use priv->secrets to work around the fact that nm_connection_clear_secrets() * will clear secrets on this object's settings. priv->secrets should be * a complete copy of this object and kept in sync by - * nm_sysconfig_connection_replace_settings(). + * nm_settings_connection_replace_settings(). */ if (!priv->secrets) { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, @@ -466,10 +465,10 @@ nm_sysconfig_connection_get_secrets (NMSysconfigConnection *connection, /**** User authorization **************************************/ -typedef void (*AuthCallback) (NMSysconfigConnection *connection, - DBusGMethodInvocation *context, - GError *error, - gpointer data); +typedef void (*AuthCallback) (NMSettingsConnection *connection, + DBusGMethodInvocation *context, + GError *error, + gpointer data); static void pk_auth_cb (NMAuthChain *chain, @@ -477,8 +476,8 @@ pk_auth_cb (NMAuthChain *chain, DBusGMethodInvocation *context, gpointer user_data) { - NMSysconfigConnection *self = NM_SYSCONFIG_CONNECTION (user_data); - NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + NMSettingsConnection *self = NM_SETTINGS_CONNECTION (user_data); + NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); GError *error = NULL; NMAuthCallResult result; AuthCallback callback; @@ -486,7 +485,7 @@ pk_auth_cb (NMAuthChain *chain, priv->pending_auths = g_slist_remove (priv->pending_auths, chain); - /* If our NMSysconfigConnection is already gone, do nothing */ + /* If our NMSettingsConnection is already gone, do nothing */ if (chain_error) { error = g_error_new (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_GENERAL, @@ -498,8 +497,8 @@ pk_auth_cb (NMAuthChain *chain, /* Caller didn't successfully authenticate */ if (result != NM_AUTH_CALL_RESULT_YES) { error = g_error_new_literal (NM_SETTINGS_ERROR, - NM_SETTINGS_ERROR_NOT_PRIVILEGED, - "Insufficient privileges."); + NM_SETTINGS_ERROR_NOT_PRIVILEGED, + "Insufficient privileges."); } } @@ -512,13 +511,13 @@ pk_auth_cb (NMAuthChain *chain, } static void -auth_start (NMSysconfigConnection *self, +auth_start (NMSettingsConnection *self, DBusGMethodInvocation *context, gboolean check_modify, AuthCallback callback, gpointer callback_data) { - NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); NMAuthChain *chain; gulong sender_uid = G_MAXULONG; GError *error = NULL; @@ -540,8 +539,8 @@ auth_start (NMSysconfigConnection *self, sender_uid, &error_desc)) { error = g_error_new_literal (NM_SETTINGS_ERROR, - NM_SETTINGS_ERROR_PERMISSION_DENIED, - error_desc); + NM_SETTINGS_ERROR_PERMISSION_DENIED, + error_desc); g_free (error_desc); goto error; } @@ -576,8 +575,7 @@ check_writable (NMConnection *connection, GError **error) g_return_val_if_fail (connection != NULL, FALSE); g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); - s_con = (NMSettingConnection *) nm_connection_get_setting (connection, - NM_TYPE_SETTING_CONNECTION); + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); if (!s_con) { g_set_error_literal (error, NM_SETTINGS_ERROR, @@ -602,7 +600,7 @@ check_writable (NMConnection *connection, GError **error) } static void -get_settings_auth_cb (NMSysconfigConnection *self, +get_settings_auth_cb (NMSettingsConnection *self, DBusGMethodInvocation *context, GError *error, gpointer data) @@ -632,14 +630,14 @@ get_settings_auth_cb (NMSysconfigConnection *self, } static void -impl_sysconfig_connection_get_settings (NMSysconfigConnection *self, - DBusGMethodInvocation *context) +impl_settings_connection_get_settings (NMSettingsConnection *self, + DBusGMethodInvocation *context) { auth_start (self, context, FALSE, get_settings_auth_cb, NULL); } static void -con_update_cb (NMSysconfigConnection *connection, +con_update_cb (NMSettingsConnection *connection, GError *error, gpointer user_data) { @@ -652,10 +650,10 @@ con_update_cb (NMSysconfigConnection *connection, } static void -update_auth_cb (NMSysconfigConnection *self, - DBusGMethodInvocation *context, - GError *error, - gpointer data) +update_auth_cb (NMSettingsConnection *self, + DBusGMethodInvocation *context, + GError *error, + gpointer data) { NMConnection *new_settings = data; @@ -665,19 +663,19 @@ update_auth_cb (NMSysconfigConnection *self, } /* Update and commit our settings. */ - nm_sysconfig_connection_replace_and_commit (self, - new_settings, - con_update_cb, - context); + nm_settings_connection_replace_and_commit (self, + new_settings, + con_update_cb, + context); out: g_object_unref (new_settings); } static void -impl_sysconfig_connection_update (NMSysconfigConnection *self, - GHashTable *new_settings, - DBusGMethodInvocation *context) +impl_settings_connection_update (NMSettingsConnection *self, + GHashTable *new_settings, + DBusGMethodInvocation *context) { NMConnection *tmp; GError *error = NULL; @@ -705,7 +703,7 @@ impl_sysconfig_connection_update (NMSysconfigConnection *self, } static void -con_delete_cb (NMSysconfigConnection *connection, +con_delete_cb (NMSettingsConnection *connection, GError *error, gpointer user_data) { @@ -718,22 +716,22 @@ con_delete_cb (NMSysconfigConnection *connection, } static void -delete_auth_cb (NMSysconfigConnection *self, - DBusGMethodInvocation *context, - GError *error, - gpointer data) +delete_auth_cb (NMSettingsConnection *self, + DBusGMethodInvocation *context, + GError *error, + gpointer data) { if (error) { dbus_g_method_return_error (context, error); return; } - nm_sysconfig_connection_delete (self, con_delete_cb, context); + nm_settings_connection_delete (self, con_delete_cb, context); } static void -impl_sysconfig_connection_delete (NMSysconfigConnection *self, - DBusGMethodInvocation *context) +impl_settings_connection_delete (NMSettingsConnection *self, + DBusGMethodInvocation *context) { GError *error = NULL; @@ -747,10 +745,10 @@ impl_sysconfig_connection_delete (NMSysconfigConnection *self, } static void -secrets_auth_cb (NMSysconfigConnection *self, - DBusGMethodInvocation *context, - GError *error, - gpointer user_data) +secrets_auth_cb (NMSettingsConnection *self, + DBusGMethodInvocation *context, + GError *error, + gpointer user_data) { char *setting_name = user_data; GHashTable *secrets; @@ -761,7 +759,7 @@ secrets_auth_cb (NMSysconfigConnection *self, goto out; } - secrets = nm_sysconfig_connection_get_secrets (self, setting_name, &error); + secrets = nm_settings_connection_get_secrets (self, setting_name, &error); if (secrets) { dbus_g_method_return (context, secrets); g_hash_table_destroy (secrets); @@ -775,9 +773,9 @@ out: } static void -impl_sysconfig_connection_get_secrets (NMSysconfigConnection *self, - const gchar *setting_name, - DBusGMethodInvocation *context) +impl_settings_connection_get_secrets (NMSettingsConnection *self, + const gchar *setting_name, + DBusGMethodInvocation *context) { auth_start (self, context, TRUE, secrets_auth_cb, g_strdup (setting_name)); } @@ -785,9 +783,9 @@ impl_sysconfig_connection_get_secrets (NMSysconfigConnection *self, /**************************************************************/ static void -nm_sysconfig_connection_init (NMSysconfigConnection *self) +nm_settings_connection_init (NMSettingsConnection *self) { - NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); static guint32 dbus_counter = 0; char *dbus_path; GError *error = NULL; @@ -801,7 +799,7 @@ nm_sysconfig_connection_init (NMSysconfigConnection *self) } dbus_path = g_strdup_printf ("%s/%u", NM_DBUS_PATH_SETTINGS, dbus_counter++); - nm_connection_set_path (NM_CONNECTION (self), dbus_path); + nm_connection_set_path (NM_CONNECTION (self), dbus_path); g_free (dbus_path); priv->visible = FALSE; @@ -815,8 +813,8 @@ nm_sysconfig_connection_init (NMSysconfigConnection *self) static void dispose (GObject *object) { - NMSysconfigConnection *self = NM_SYSCONFIG_CONNECTION (object); - NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + NMSettingsConnection *self = NM_SETTINGS_CONNECTION (object); + NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); GSList *iter; if (priv->secrets) @@ -832,16 +830,16 @@ dispose (GObject *object) g_object_unref (priv->session_monitor); - G_OBJECT_CLASS (nm_sysconfig_connection_parent_class)->dispose (object); + G_OBJECT_CLASS (nm_settings_connection_parent_class)->dispose (object); } static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_VISIBLE: - g_value_set_boolean (value, NM_SYSCONFIG_CONNECTION_GET_PRIVATE (object)->visible); + g_value_set_boolean (value, NM_SETTINGS_CONNECTION_GET_PRIVATE (object)->visible); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -851,17 +849,17 @@ get_property (GObject *object, guint prop_id, static void set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) + const GValue *value, GParamSpec *pspec) { G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } static void -nm_sysconfig_connection_class_init (NMSysconfigConnectionClass *class) +nm_settings_connection_class_init (NMSettingsConnectionClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - g_type_class_add_private (class, sizeof (NMSysconfigConnectionPrivate)); + g_type_class_add_private (class, sizeof (NMSettingsConnectionPrivate)); /* Virtual methods */ object_class->dispose = dispose; @@ -875,7 +873,7 @@ nm_sysconfig_connection_class_init (NMSysconfigConnectionClass *class) /* Properties */ g_object_class_install_property (object_class, PROP_VISIBLE, - g_param_spec_boolean (NM_SYSCONFIG_CONNECTION_VISIBLE, + g_param_spec_boolean (NM_SETTINGS_CONNECTION_VISIBLE, "Visible", "Visible", FALSE, @@ -883,7 +881,7 @@ nm_sysconfig_connection_class_init (NMSysconfigConnectionClass *class) /* Signals */ signals[UPDATED] = - g_signal_new (NM_SYSCONFIG_CONNECTION_UPDATED, + g_signal_new (NM_SETTINGS_CONNECTION_UPDATED, G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_FIRST, 0, @@ -892,7 +890,7 @@ nm_sysconfig_connection_class_init (NMSysconfigConnectionClass *class) G_TYPE_NONE, 0); signals[REMOVED] = - g_signal_new (NM_SYSCONFIG_CONNECTION_REMOVED, + g_signal_new (NM_SETTINGS_CONNECTION_REMOVED, G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_FIRST, 0, @@ -901,6 +899,5 @@ nm_sysconfig_connection_class_init (NMSysconfigConnectionClass *class) G_TYPE_NONE, 0); dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (class), - &dbus_glib_nm_sysconfig_connection_object_info); - + &dbus_glib_nm_settings_connection_object_info); } diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h new file mode 100644 index 0000000000..e62aa4b97d --- /dev/null +++ b/src/settings/nm-settings-connection.h @@ -0,0 +1,101 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2008 Novell, Inc. + * (C) Copyright 2008 - 2011 Red Hat, Inc. + */ + +#ifndef NM_SETTINGS_CONNECTION_H +#define NM_SETTINGS_CONNECTION_H + +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTINGS_CONNECTION (nm_settings_connection_get_type ()) +#define NM_SETTINGS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_CONNECTION, NMSettingsConnection)) +#define NM_SETTINGS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTINGS_CONNECTION, NMSettingsConnectionClass)) +#define NM_IS_SETTINGS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS_CONNECTION)) +#define NM_IS_SETTINGS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTINGS_CONNECTION)) +#define NM_SETTINGS_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS_CONNECTION, NMSettingsConnectionClass)) + +#define NM_SETTINGS_CONNECTION_UPDATED "updated" +#define NM_SETTINGS_CONNECTION_REMOVED "removed" +#define NM_SETTINGS_CONNECTION_VISIBLE "visible" + +typedef struct _NMSettingsConnection NMSettingsConnection; + +typedef struct _NMSettingsConnectionClass NMSettingsConnectionClass; + +typedef void (*NMSettingsConnectionCommitFunc) (NMSettingsConnection *connection, + GError *error, + gpointer user_data); + +typedef void (*NMSettingsConnectionDeleteFunc) (NMSettingsConnection *connection, + GError *error, + gpointer user_data); + +struct _NMSettingsConnection { + NMConnection parent; +}; + +struct _NMSettingsConnectionClass { + NMConnectionClass parent; + + void (*commit_changes) (NMSettingsConnection *connection, + NMSettingsConnectionCommitFunc callback, + gpointer user_data); + + void (*delete) (NMSettingsConnection *connection, + NMSettingsConnectionDeleteFunc callback, + gpointer user_data); + + gboolean (*supports_secrets) (NMSettingsConnection *connection, + const char *setting_name); +}; + +GType nm_settings_connection_get_type (void); + +void nm_settings_connection_commit_changes (NMSettingsConnection *connection, + NMSettingsConnectionCommitFunc callback, + gpointer user_data); + +gboolean nm_settings_connection_replace_settings (NMSettingsConnection *self, + NMConnection *new_settings, + GError **error); + +void nm_settings_connection_replace_and_commit (NMSettingsConnection *self, + NMConnection *new_settings, + NMSettingsConnectionCommitFunc callback, + gpointer user_data); + +void nm_settings_connection_delete (NMSettingsConnection *connection, + NMSettingsConnectionDeleteFunc callback, + gpointer user_data); + +GHashTable *nm_settings_connection_get_secrets (NMSettingsConnection *connection, + const char *setting_name, + GError **error); + +gboolean nm_settings_connection_is_visible (NMSettingsConnection *self); + +void nm_settings_connection_recheck_visibility (NMSettingsConnection *self); + +G_END_DECLS + +#endif /* NM_SETTINGS_CONNECTION_H */ diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index 2f299c8d65..542c398a63 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -54,7 +54,7 @@ #include "../nm-device-ethernet.h" #include "nm-dbus-glib-types.h" #include "nm-settings.h" -#include "nm-sysconfig-connection.h" +#include "nm-settings-connection.h" #include "nm-polkit-helpers.h" #include "nm-settings-error.h" #include "nm-default-wired-connection.h" @@ -75,13 +75,13 @@ EXPORT(nm_inotify_helper_get) EXPORT(nm_inotify_helper_add_watch) EXPORT(nm_inotify_helper_remove_watch) -EXPORT(nm_sysconfig_connection_get_type) -EXPORT(nm_sysconfig_connection_replace_settings) -EXPORT(nm_sysconfig_connection_replace_and_commit) +EXPORT(nm_settings_connection_get_type) +EXPORT(nm_settings_connection_replace_settings) +EXPORT(nm_settings_connection_replace_and_commit) /* END LINKER CRACKROCK */ static void claim_connection (NMSettings *self, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, gboolean do_export); static gboolean impl_settings_list_connections (NMSettings *self, @@ -164,7 +164,7 @@ load_connections (NMSettings *self) // priority plugin. for (elt = plugin_connections; elt; elt = g_slist_next (elt)) - claim_connection (self, NM_SYSCONFIG_CONNECTION (elt->data), TRUE); + claim_connection (self, NM_SETTINGS_CONNECTION (elt->data), TRUE); g_slist_free (plugin_connections); } @@ -196,7 +196,7 @@ nm_settings_for_each_connection (NMSettings *self, g_hash_table_iter_init (&iter, priv->connections); while (g_hash_table_iter_next (&iter, NULL, &data)) - for_each_func (self, NM_SYSCONFIG_CONNECTION (data), user_data); + for_each_func (self, NM_SETTINGS_CONNECTION (data), user_data); } static gboolean @@ -243,7 +243,7 @@ connection_sort (gconstpointer pa, gconstpointer pb) return 1; } -/* Returns a list of NMSysconfigConnections. Caller must free the list with +/* Returns a list of NMSettingsConnections. Caller must free the list with * g_slist_free(). */ GSList * @@ -261,7 +261,7 @@ nm_settings_get_connections (NMSettings *self) return list; } -NMSysconfigConnection * +NMSettingsConnection * nm_settings_get_connection_by_path (NMSettings *self, const char *path) { NMSettingsPrivate *priv; @@ -274,7 +274,7 @@ nm_settings_get_connection_by_path (NMSettings *self, const char *path) load_connections (self); - return (NMSysconfigConnection *) g_hash_table_lookup (priv->connections, path); + return (NMSettingsConnection *) g_hash_table_lookup (priv->connections, path); } static void @@ -389,7 +389,7 @@ nm_settings_get_hostname (NMSettings *self) static void plugin_connection_added (NMSystemConfigInterface *config, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, gpointer user_data) { claim_connection (NM_SETTINGS (user_data), connection, TRUE); @@ -586,7 +586,7 @@ load_plugins (NMSettings *self, const char *plugins, GError **error) #define VISIBLE_ID_TAG "visible-id-tag" static void -connection_removed (NMSysconfigConnection *obj, gpointer user_data) +connection_removed (NMSettingsConnection *obj, gpointer user_data) { NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (user_data); GObject *connection = G_OBJECT (obj); @@ -626,7 +626,7 @@ connection_removed (NMSysconfigConnection *obj, gpointer user_data) } static void -connection_updated (NMSysconfigConnection *connection, gpointer user_data) +connection_updated (NMSettingsConnection *connection, gpointer user_data) { /* Re-emit for listeners like NMPolicy */ g_signal_emit (NM_SETTINGS (user_data), @@ -636,7 +636,7 @@ connection_updated (NMSysconfigConnection *connection, gpointer user_data) } static void -connection_visibility_changed (NMSysconfigConnection *connection, +connection_visibility_changed (NMSettingsConnection *connection, GParamSpec *pspec, gpointer user_data) { @@ -649,7 +649,7 @@ connection_visibility_changed (NMSysconfigConnection *connection, static void claim_connection (NMSettings *self, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, gboolean do_export) { NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); @@ -660,7 +660,7 @@ claim_connection (NMSettings *self, char *path; guint id; - g_return_if_fail (NM_IS_SYSCONFIG_CONNECTION (connection)); + g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection)); g_return_if_fail (nm_connection_get_path (NM_CONNECTION (connection)) == NULL); g_hash_table_iter_init (&iter, priv->connections); @@ -679,19 +679,19 @@ claim_connection (NMSettings *self, } /* Ensure it's initial visibility is up-to-date */ - nm_sysconfig_connection_recheck_visibility (connection); + nm_settings_connection_recheck_visibility (connection); - id = g_signal_connect (connection, NM_SYSCONFIG_CONNECTION_REMOVED, + id = g_signal_connect (connection, NM_SETTINGS_CONNECTION_REMOVED, G_CALLBACK (connection_removed), self); g_object_set_data (G_OBJECT (connection), REMOVED_ID_TAG, GUINT_TO_POINTER (id)); - id = g_signal_connect (connection, NM_SYSCONFIG_CONNECTION_UPDATED, + id = g_signal_connect (connection, NM_SETTINGS_CONNECTION_UPDATED, G_CALLBACK (connection_updated), self); g_object_set_data (G_OBJECT (connection), UPDATED_ID_TAG, GUINT_TO_POINTER (id)); - id = g_signal_connect (connection, "notify::" NM_SYSCONFIG_CONNECTION_VISIBLE, + id = g_signal_connect (connection, "notify::" NM_SETTINGS_CONNECTION_VISIBLE, G_CALLBACK (connection_visibility_changed), self); g_object_set_data (G_OBJECT (connection), VISIBLE_ID_TAG, GUINT_TO_POINTER (id)); @@ -726,31 +726,31 @@ claim_connection (NMSettings *self, // *needs* a better name! static void remove_default_wired_connection (NMSettings *self, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, gboolean do_signal) { NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); const char *path = nm_connection_get_path (NM_CONNECTION (connection)); if (g_hash_table_lookup (priv->connections, path)) { - g_signal_emit_by_name (G_OBJECT (connection), NM_SYSCONFIG_CONNECTION_REMOVED); + g_signal_emit_by_name (G_OBJECT (connection), NM_SETTINGS_SIGNAL_CONNECTION_REMOVED); g_hash_table_remove (priv->connections, path); } } -static NMSysconfigConnection * +static NMSettingsConnection * add_new_connection (NMSettings *self, NMConnection *connection, GError **error) { NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); GSList *iter; - NMSysconfigConnection *added = NULL; + NMSettingsConnection *added = NULL; /* 1) plugin writes the NMConnection to disk - * 2) plugin creates a new NMSysconfigConnection subclass with the settings + * 2) plugin creates a new NMSettingsConnection subclass with the settings * from the NMConnection and returns it to the settings service - * 3) settings service exports the new NMSysconfigConnection subclass + * 3) settings service exports the new NMSettingsConnection subclass * 4) plugin notices that something on the filesystem has changed * 5) plugin reads the changes and ignores them because they will * contain the same data as the connection it already knows about @@ -781,7 +781,7 @@ pk_add_cb (NMAuthChain *chain, NMAuthCallResult result; GError *error = NULL, *add_error = NULL; NMConnection *connection; - NMSysconfigConnection *added = NULL; + NMSettingsConnection *added = NULL; gulong caller_uid = G_MAXULONG; char *error_desc = NULL; NMSettingsAddCallback callback; @@ -858,7 +858,7 @@ done: static void add_cb (NMSettings *self, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, GError *error, DBusGMethodInvocation *context, gpointer user_data) @@ -935,7 +935,7 @@ pk_hostname_cb (NMAuthChain *chain, priv->auths = g_slist_remove (priv->auths, chain); - /* If our NMSysconfigConnection is already gone, do nothing */ + /* If our NMSettingsConnection is already gone, do nothing */ if (chain_error) { error = g_error_new (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_GENERAL, @@ -1209,7 +1209,7 @@ cleanup: } static void -delete_cb (NMSysconfigConnection *connection, GError *error, gpointer user_data) +delete_cb (NMSettingsConnection *connection, GError *error, gpointer user_data) { } @@ -1220,7 +1220,7 @@ default_wired_try_update (NMDefaultWiredConnection *wired, GError *error = NULL; NMSettingConnection *s_con; const char *id; - NMSysconfigConnection *added; + NMSettingsConnection *added; /* Try to move this default wired conneciton to a plugin so that it has * persistent storage. @@ -1232,12 +1232,10 @@ default_wired_try_update (NMDefaultWiredConnection *wired, id = nm_setting_connection_get_id (s_con); g_assert (id); - remove_default_wired_connection (self, NM_SYSCONFIG_CONNECTION (wired), FALSE); + remove_default_wired_connection (self, NM_SETTINGS_CONNECTION (wired), FALSE); added = add_new_connection (self, NM_CONNECTION (wired), &error); if (added) { - nm_sysconfig_connection_delete (NM_SYSCONFIG_CONNECTION (wired), - delete_cb, - NULL); + nm_settings_connection_delete (NM_SETTINGS_CONNECTION (wired), delete_cb, NULL); g_object_set_data (G_OBJECT (nm_default_wired_connection_get_device (wired)), DEFAULT_WIRED_TAG, @@ -1256,7 +1254,7 @@ default_wired_try_update (NMDefaultWiredConnection *wired, * but add it back to the system settings service. Connection is already * exported on the bus, don't export it again, thus do_export == FALSE. */ - claim_connection (self, NM_SYSCONFIG_CONNECTION (wired), FALSE); + claim_connection (self, NM_SETTINGS_CONNECTION (wired), FALSE); return TRUE; } @@ -1307,7 +1305,7 @@ nm_settings_device_added (NMSettings *self, NMDevice *device) g_signal_connect (wired, "try-update", (GCallback) default_wired_try_update, self); g_signal_connect (wired, "deleted", (GCallback) default_wired_deleted, self); - claim_connection (self, NM_SYSCONFIG_CONNECTION (wired), TRUE); + claim_connection (self, NM_SETTINGS_CONNECTION (wired), TRUE); g_object_unref (wired); g_object_set_data (G_OBJECT (device), DEFAULT_WIRED_TAG, wired); @@ -1326,7 +1324,7 @@ nm_settings_device_removed (NMSettings *self, NMDevice *device) connection = (NMDefaultWiredConnection *) g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_TAG); if (connection) - remove_default_wired_connection (self, NM_SYSCONFIG_CONNECTION (connection), TRUE); + remove_default_wired_connection (self, NM_SETTINGS_CONNECTION (connection), TRUE); } /***************************************************************/ @@ -1508,7 +1506,7 @@ nm_settings_class_init (NMSettingsClass *class) g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, DBUS_TYPE_G_MAP_OF_VARIANT); signals[CONNECTION_ADDED] = - g_signal_new (NM_SETTINGS_CONNECTION_ADDED, + g_signal_new (NM_SETTINGS_SIGNAL_CONNECTION_ADDED, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMSettingsClass, connection_added), @@ -1517,7 +1515,7 @@ nm_settings_class_init (NMSettingsClass *class) G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[CONNECTION_UPDATED] = - g_signal_new (NM_SETTINGS_CONNECTION_UPDATED, + g_signal_new (NM_SETTINGS_SIGNAL_CONNECTION_UPDATED, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMSettingsClass, connection_updated), @@ -1526,7 +1524,7 @@ nm_settings_class_init (NMSettingsClass *class) G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[CONNECTION_REMOVED] = - g_signal_new (NM_SETTINGS_CONNECTION_REMOVED, + g_signal_new (NM_SETTINGS_SIGNAL_CONNECTION_REMOVED, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMSettingsClass, connection_removed), @@ -1535,7 +1533,7 @@ nm_settings_class_init (NMSettingsClass *class) G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[CONNECTION_VISIBILITY_CHANGED] = - g_signal_new (NM_SETTINGS_CONNECTION_VISIBILITY_CHANGED, + g_signal_new (NM_SETTINGS_SIGNAL_CONNECTION_VISIBILITY_CHANGED, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMSettingsClass, connection_visibility_changed), @@ -1544,7 +1542,7 @@ nm_settings_class_init (NMSettingsClass *class) G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[CONNECTIONS_LOADED] = - g_signal_new (NM_SETTINGS_CONNECTIONS_LOADED, + g_signal_new (NM_SETTINGS_SIGNAL_CONNECTIONS_LOADED, G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (NMSettingsClass, connections_loaded), diff --git a/src/settings/nm-settings.h b/src/settings/nm-settings.h index 0ba3170d17..9b478ca92c 100644 --- a/src/settings/nm-settings.h +++ b/src/settings/nm-settings.h @@ -28,7 +28,7 @@ #include -#include "nm-sysconfig-connection.h" +#include "nm-settings-connection.h" #include "nm-system-config-interface.h" #include "nm-device.h" @@ -43,11 +43,11 @@ #define NM_SETTINGS_HOSTNAME "hostname" #define NM_SETTINGS_CAN_MODIFY "can-modify" -#define NM_SETTINGS_CONNECTION_ADDED "connection-added" -#define NM_SETTINGS_CONNECTION_UPDATED "connection-updated" -#define NM_SETTINGS_CONNECTION_REMOVED "connection-removed" -#define NM_SETTINGS_CONNECTION_VISIBILITY_CHANGED "connection-visibility-changed" -#define NM_SETTINGS_CONNECTIONS_LOADED "connections-loaded" +#define NM_SETTINGS_SIGNAL_CONNECTION_ADDED "connection-added" +#define NM_SETTINGS_SIGNAL_CONNECTION_UPDATED "connection-updated" +#define NM_SETTINGS_SIGNAL_CONNECTION_REMOVED "connection-removed" +#define NM_SETTINGS_SIGNAL_CONNECTION_VISIBILITY_CHANGED "connection-visibility-changed" +#define NM_SETTINGS_SIGNAL_CONNECTIONS_LOADED "connections-loaded" typedef struct { GObject parent_instance; @@ -77,7 +77,7 @@ NMSettings *nm_settings_new (const char *config_file, GError **error); typedef void (*NMSettingsForEachFunc) (NMSettings *settings, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, gpointer user_data); void nm_settings_for_each_connection (NMSettings *settings, @@ -85,7 +85,7 @@ void nm_settings_for_each_connection (NMSettings *settings, gpointer user_data); typedef void (*NMSettingsAddCallback) (NMSettings *settings, - NMSysconfigConnection *connection, + NMSettingsConnection *connection, GError *error, DBusGMethodInvocation *context, gpointer user_data); @@ -96,13 +96,13 @@ void nm_settings_add_connection (NMSettings *self, NMSettingsAddCallback callback, gpointer user_data); -/* Returns a list of NMSysconfigConnections. Caller must free the list with +/* Returns a list of NMSettingsConnections. Caller must free the list with * g_slist_free(). */ GSList *nm_settings_get_connections (NMSettings *settings); -NMSysconfigConnection *nm_settings_get_connection_by_path (NMSettings *settings, - const char *path); +NMSettingsConnection *nm_settings_get_connection_by_path (NMSettings *settings, + const char *path); const GSList *nm_settings_get_unmanaged_specs (NMSettings *self); diff --git a/src/settings/nm-sysconfig-connection.h b/src/settings/nm-sysconfig-connection.h deleted file mode 100644 index 84196a366c..0000000000 --- a/src/settings/nm-sysconfig-connection.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager system settings service - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * (C) Copyright 2008 Novell, Inc. - * (C) Copyright 2008 - 2011 Red Hat, Inc. - */ - -#ifndef NM_SYSCONFIG_CONNECTION_H -#define NM_SYSCONFIG_CONNECTION_H - -#include -#include - -G_BEGIN_DECLS - -#define NM_TYPE_SYSCONFIG_CONNECTION (nm_sysconfig_connection_get_type ()) -#define NM_SYSCONFIG_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SYSCONFIG_CONNECTION, NMSysconfigConnection)) -#define NM_SYSCONFIG_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SYSCONFIG_CONNECTION, NMSysconfigConnectionClass)) -#define NM_IS_SYSCONFIG_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SYSCONFIG_CONNECTION)) -#define NM_IS_SYSCONFIG_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SYSCONFIG_CONNECTION)) -#define NM_SYSCONFIG_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SYSCONFIG_CONNECTION, NMSysconfigConnectionClass)) - -#define NM_SYSCONFIG_CONNECTION_UPDATED "updated" -#define NM_SYSCONFIG_CONNECTION_REMOVED "removed" -#define NM_SYSCONFIG_CONNECTION_VISIBLE "visible" - -typedef struct _NMSysconfigConnection NMSysconfigConnection; - -typedef struct _NMSysconfigConnectionClass NMSysconfigConnectionClass; - -typedef void (*NMSysconfigConnectionCommitFunc) (NMSysconfigConnection *connection, - GError *error, - gpointer user_data); - -typedef void (*NMSysconfigConnectionDeleteFunc) (NMSysconfigConnection *connection, - GError *error, - gpointer user_data); - -struct _NMSysconfigConnection { - NMConnection parent; -}; - -struct _NMSysconfigConnectionClass { - NMConnectionClass parent; - - void (*commit_changes) (NMSysconfigConnection *connection, - NMSysconfigConnectionCommitFunc callback, - gpointer user_data); - - void (*delete) (NMSysconfigConnection *connection, - NMSysconfigConnectionDeleteFunc callback, - gpointer user_data); - - gboolean (*supports_secrets) (NMSysconfigConnection *connection, - const char *setting_name); -}; - -GType nm_sysconfig_connection_get_type (void); - -void nm_sysconfig_connection_commit_changes (NMSysconfigConnection *connection, - NMSysconfigConnectionCommitFunc callback, - gpointer user_data); - -gboolean nm_sysconfig_connection_replace_settings (NMSysconfigConnection *self, - NMConnection *new_settings, - GError **error); - -void nm_sysconfig_connection_replace_and_commit (NMSysconfigConnection *self, - NMConnection *new_settings, - NMSysconfigConnectionCommitFunc callback, - gpointer user_data); - -void nm_sysconfig_connection_delete (NMSysconfigConnection *connection, - NMSysconfigConnectionDeleteFunc callback, - gpointer user_data); - -GHashTable *nm_sysconfig_connection_get_secrets (NMSysconfigConnection *connection, - const char *setting_name, - GError **error); - -gboolean nm_sysconfig_connection_is_visible (NMSysconfigConnection *self); - -void nm_sysconfig_connection_recheck_visibility (NMSysconfigConnection *self); - -G_END_DECLS - -#endif /* NM_SYSCONFIG_CONNECTION_H */ diff --git a/src/settings/nm-system-config-interface.c b/src/settings/nm-system-config-interface.c index b5f9d72078..b7fcfd6078 100644 --- a/src/settings/nm-system-config-interface.c +++ b/src/settings/nm-system-config-interface.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2011 Red Hat, Inc. * Copyright (C) 2008 Novell, Inc. */ @@ -73,7 +73,7 @@ interface_init (gpointer g_iface) NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, - NM_TYPE_SYSCONFIG_CONNECTION); + NM_TYPE_SETTINGS_CONNECTION); g_signal_new (NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED, iface_type, @@ -146,7 +146,7 @@ nm_system_config_interface_get_unmanaged_specs (NMSystemConfigInterface *config) return NULL; } -NMSysconfigConnection * +NMSettingsConnection * nm_system_config_interface_add_connection (NMSystemConfigInterface *config, NMConnection *connection, GError **error) diff --git a/src/settings/nm-system-config-interface.h b/src/settings/nm-system-config-interface.h index f31beabc34..fb394785df 100644 --- a/src/settings/nm-system-config-interface.h +++ b/src/settings/nm-system-config-interface.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2011 Red Hat, Inc. * Copyright (C) 2008 Novell, Inc. */ @@ -25,7 +25,7 @@ #include #include #include -#include +#include G_BEGIN_DECLS @@ -90,7 +90,7 @@ struct _NMSystemConfigInterface { /* Called when the plugin is loaded to initialize it */ void (*init) (NMSystemConfigInterface *config); - /* Returns a GSList of NMSysconfigConnection objects that represent + /* Returns a GSList of NMSettingsConnection objects that represent * connections the plugin knows about. The returned list is freed by the * system settings service. */ @@ -118,18 +118,18 @@ struct _NMSystemConfigInterface { /* * Save the given connection to backing storage, and return a new - * NMSysconfigConnection subclass that contains the same settings as the + * NMSettingsConnection subclass that contains the same settings as the * original connection. */ - NMSysconfigConnection * (*add_connection) (NMSystemConfigInterface *config, - NMConnection *connection, - GError **error); + NMSettingsConnection * (*add_connection) (NMSystemConfigInterface *config, + NMConnection *connection, + GError **error); /* Signals */ /* Emitted when a new connection has been found by the plugin */ void (*connection_added) (NMSystemConfigInterface *config, - NMSysconfigConnection *connection); + NMSettingsConnection *connection); /* Emitted when the list of unmanaged device specifications changes */ void (*unmanaged_specs_changed) (NMSystemConfigInterface *config); @@ -144,9 +144,9 @@ GSList *nm_system_config_interface_get_connections (NMSystemConfigInterface *con GSList *nm_system_config_interface_get_unmanaged_specs (NMSystemConfigInterface *config); -NMSysconfigConnection *nm_system_config_interface_add_connection (NMSystemConfigInterface *config, - NMConnection *connection, - GError **error); +NMSettingsConnection *nm_system_config_interface_add_connection (NMSystemConfigInterface *config, + NMConnection *connection, + GError **error); G_END_DECLS diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index 218054c1c4..52c172dae4 100644 --- a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -40,7 +40,7 @@ #include "writer.h" #include "nm-inotify-helper.h" -G_DEFINE_TYPE (NMIfcfgConnection, nm_ifcfg_connection, NM_TYPE_SYSCONFIG_CONNECTION) +G_DEFINE_TYPE (NMIfcfgConnection, nm_ifcfg_connection, NM_TYPE_SETTINGS_CONNECTION) #define NM_IFCFG_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IFCFG_CONNECTION, NMIfcfgConnectionPrivate)) @@ -134,7 +134,7 @@ nm_ifcfg_connection_new (const char *full_path, goto out; /* Update our settings with what was read from the file */ - if (!nm_sysconfig_connection_replace_settings (NM_SYSCONFIG_CONNECTION (object), tmp, error)) { + if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object), tmp, error)) { g_object_unref (object); object = NULL; goto out; @@ -179,8 +179,8 @@ nm_ifcfg_connection_get_unmanaged_spec (NMIfcfgConnection *self) } static void -commit_changes (NMSysconfigConnection *connection, - NMSysconfigConnectionCommitFunc callback, +commit_changes (NMSettingsConnection *connection, + NMSettingsConnectionCommitFunc callback, gpointer user_data) { NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (connection); @@ -218,12 +218,12 @@ commit_changes (NMSysconfigConnection *connection, out: if (reread) g_object_unref (reread); - NM_SYSCONFIG_CONNECTION_CLASS (nm_ifcfg_connection_parent_class)->commit_changes (connection, callback, user_data); + NM_SETTINGS_CONNECTION_CLASS (nm_ifcfg_connection_parent_class)->commit_changes (connection, callback, user_data); } static void -do_delete (NMSysconfigConnection *connection, - NMSysconfigConnectionDeleteFunc callback, +do_delete (NMSettingsConnection *connection, + NMSettingsConnectionDeleteFunc callback, gpointer user_data) { NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (connection); @@ -237,7 +237,7 @@ do_delete (NMSysconfigConnection *connection, if (priv->route6file) g_unlink (priv->route6file); - NM_SYSCONFIG_CONNECTION_CLASS (nm_ifcfg_connection_parent_class)->delete (connection, callback, user_data); + NM_SETTINGS_CONNECTION_CLASS (nm_ifcfg_connection_parent_class)->delete (connection, callback, user_data); } /* GObject */ @@ -315,7 +315,7 @@ static void nm_ifcfg_connection_class_init (NMIfcfgConnectionClass *ifcfg_connection_class) { GObjectClass *object_class = G_OBJECT_CLASS (ifcfg_connection_class); - NMSysconfigConnectionClass *sysconfig_class = NM_SYSCONFIG_CONNECTION_CLASS (ifcfg_connection_class); + NMSettingsConnectionClass *settings_class = NM_SETTINGS_CONNECTION_CLASS (ifcfg_connection_class); g_type_class_add_private (ifcfg_connection_class, sizeof (NMIfcfgConnectionPrivate)); @@ -323,8 +323,8 @@ nm_ifcfg_connection_class_init (NMIfcfgConnectionClass *ifcfg_connection_class) object_class->set_property = set_property; object_class->get_property = get_property; object_class->finalize = finalize; - sysconfig_class->delete = do_delete; - sysconfig_class->commit_changes = commit_changes; + settings_class->delete = do_delete; + settings_class->commit_changes = commit_changes; /* Properties */ g_object_class_install_property diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h index 4d9d699bc5..731aa598c3 100644 --- a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2011 Red Hat, Inc. */ #ifndef NM_IFCFG_CONNECTION_H @@ -24,7 +24,7 @@ G_BEGIN_DECLS #include -#include +#include #define NM_TYPE_IFCFG_CONNECTION (nm_ifcfg_connection_get_type ()) #define NM_IFCFG_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IFCFG_CONNECTION, NMIfcfgConnection)) @@ -36,11 +36,11 @@ G_BEGIN_DECLS #define NM_IFCFG_CONNECTION_UNMANAGED "unmanaged" typedef struct { - NMSysconfigConnection parent; + NMSettingsConnection parent; } NMIfcfgConnection; typedef struct { - NMSysconfigConnectionClass parent; + NMSettingsConnectionClass parent; } NMIfcfgConnectionClass; GType nm_ifcfg_connection_get_type (void); diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index b718574a19..24e271df3b 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -18,7 +18,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2007 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2011 Red Hat, Inc. */ #include @@ -195,10 +195,10 @@ read_connections (SCPluginIfcfg *plugin) /* Monitoring */ -/* Callback for nm_sysconfig_connection_replace_and_commit. Report any errors +/* Callback for nm_settings_connection_replace_and_commit. Report any errors * encountered when commiting connection settings updates. */ static void -commit_cb (NMSysconfigConnection *connection, GError *error, gpointer unused) +commit_cb (NMSettingsConnection *connection, GError *error, gpointer unused) { if (error) { PLUGIN_WARN (IFCFG_PLUGIN_NAME, " error updating: %s", @@ -221,7 +221,7 @@ remove_connection (SCPluginIfcfg *self, NMIfcfgConnection *connection) g_object_ref (connection); g_hash_table_remove (priv->connections, path); - g_signal_emit_by_name (connection, NM_SYSCONFIG_CONNECTION_REMOVED); + g_signal_emit_by_name (connection, NM_SETTINGS_CONNECTION_REMOVED); g_object_unref (connection); /* Emit unmanaged changes _after_ removing the connection */ @@ -294,7 +294,7 @@ connection_new_or_changed (SCPluginIfcfg *self, * been removed, and notify the settings service by signalling that * unmanaged specs have changed. */ - g_signal_emit_by_name (existing, NM_SYSCONFIG_CONNECTION_REMOVED); + g_signal_emit_by_name (existing, NM_SETTINGS_CONNECTION_REMOVED); g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); } } else { @@ -312,9 +312,9 @@ connection_new_or_changed (SCPluginIfcfg *self, g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, existing); } - nm_sysconfig_connection_replace_and_commit (NM_SYSCONFIG_CONNECTION (existing), - NM_CONNECTION (new), - commit_cb, NULL); + nm_settings_connection_replace_and_commit (NM_SETTINGS_CONNECTION (existing), + NM_CONNECTION (new), + commit_cb, NULL); /* Update unmanaged status */ g_object_set (existing, NM_IFCFG_CONNECTION_UNMANAGED, new_unmanaged, NULL); @@ -445,7 +445,7 @@ get_unmanaged_specs (NMSystemConfigInterface *config) return list; } -static NMSysconfigConnection * +static NMSettingsConnection * add_connection (NMSystemConfigInterface *config, NMConnection *connection, GError **error) @@ -459,7 +459,7 @@ add_connection (NMSystemConfigInterface *config, added = _internal_new_connection (self, path, connection, error); g_free (path); } - return (NMSysconfigConnection *) added; + return (NMSettingsConnection *) added; } #define SC_NETWORK_FILE SYSCONFDIR"/sysconfig/network" diff --git a/system-settings/plugins/ifnet/nm-ifnet-connection.c b/system-settings/plugins/ifnet/nm-ifnet-connection.c index 8e774de8f3..16a21bafa2 100644 --- a/system-settings/plugins/ifnet/nm-ifnet-connection.c +++ b/system-settings/plugins/ifnet/nm-ifnet-connection.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include "nm-ifnet-connection.h" @@ -34,7 +34,7 @@ #include "wpa_parser.h" #include "plugin.h" -G_DEFINE_TYPE (NMIfnetConnection, nm_ifnet_connection, NM_TYPE_SYSCONFIG_CONNECTION) +G_DEFINE_TYPE (NMIfnetConnection, nm_ifnet_connection, NM_TYPE_SETTINGS_CONNECTION) #define NM_IFNET_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionPrivate)) enum { @@ -80,7 +80,7 @@ nm_ifnet_connection_new (const char *conn_name, NMConnection *source) } NM_IFNET_CONNECTION_GET_PRIVATE (object)->conn_name = g_strdup (conn_name); - nm_sysconfig_connection_replace_settings (NM_SYSCONFIG_CONNECTION (object), tmp, NULL); + nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object), tmp, NULL); g_object_unref (tmp); return NM_IFNET_CONNECTION (object); @@ -92,8 +92,8 @@ nm_ifnet_connection_init (NMIfnetConnection * connection) } static void -commit_changes (NMSysconfigConnection *connection, - NMSysconfigConnectionCommitFunc callback, +commit_changes (NMSettingsConnection *connection, + NMSettingsConnectionCommitFunc callback, gpointer user_data) { GError *error = NULL; @@ -118,15 +118,15 @@ commit_changes (NMSysconfigConnection *connection, g_free (priv->conn_name); priv->conn_name = g_strdup (new_name); - NM_SYSCONFIG_CONNECTION_CLASS (nm_ifnet_connection_parent_class)->commit_changes (connection, callback, user_data); + NM_SETTINGS_CONNECTION_CLASS (nm_ifnet_connection_parent_class)->commit_changes (connection, callback, user_data); PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Successfully updated %s", priv->conn_name); g_signal_emit (connection, signals[IFNET_SETUP_MONITORS], 0); } static void -do_delete (NMSysconfigConnection *connection, - NMSysconfigConnectionDeleteFunc callback, +do_delete (NMSettingsConnection *connection, + NMSettingsConnectionDeleteFunc callback, gpointer user_data) { GError *error = NULL; @@ -144,7 +144,7 @@ do_delete (NMSysconfigConnection *connection, return; } - NM_SYSCONFIG_CONNECTION_CLASS (nm_ifnet_connection_parent_class)->delete (connection, callback, user_data); + NM_SETTINGS_CONNECTION_CLASS (nm_ifnet_connection_parent_class)->delete (connection, callback, user_data); PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Successfully deleted %s", priv->conn_name); @@ -167,14 +167,14 @@ static void nm_ifnet_connection_class_init (NMIfnetConnectionClass * ifnet_connection_class) { GObjectClass *object_class = G_OBJECT_CLASS (ifnet_connection_class); - NMSysconfigConnectionClass *sysconfig_class = NM_SYSCONFIG_CONNECTION_CLASS (ifnet_connection_class); + NMSettingsConnectionClass *settings_class = NM_SETTINGS_CONNECTION_CLASS (ifnet_connection_class); g_type_class_add_private (ifnet_connection_class, sizeof (NMIfnetConnectionPrivate)); object_class->finalize = finalize; - sysconfig_class->delete = do_delete; - sysconfig_class->commit_changes = commit_changes; + settings_class->delete = do_delete; + settings_class->commit_changes = commit_changes; signals[IFNET_SETUP_MONITORS] = g_signal_new ("ifnet_setup_monitors", diff --git a/system-settings/plugins/ifnet/nm-ifnet-connection.h b/system-settings/plugins/ifnet/nm-ifnet-connection.h index cde260a456..9423f20d71 100644 --- a/system-settings/plugins/ifnet/nm-ifnet-connection.h +++ b/system-settings/plugins/ifnet/nm-ifnet-connection.h @@ -22,7 +22,7 @@ #ifndef NM_IFNET_CONNECTION_H #define NM_IFNET_CONNECTION_H -#include +#include #include "net_parser.h" G_BEGIN_DECLS @@ -35,11 +35,11 @@ G_BEGIN_DECLS #define NM_IFNET_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IFNET_CONNECTION, NMIfnetConnectionClass)) typedef struct { - NMSysconfigConnection parent; + NMSettingsConnection parent; } NMIfnetConnection; typedef struct { - NMSysconfigConnectionClass parent; + NMSettingsConnectionClass parent; } NMIfnetConnectionClass; GType nm_ifnet_connection_get_type (void); diff --git a/system-settings/plugins/ifnet/plugin.c b/system-settings/plugins/ifnet/plugin.c index 710b9b5b5f..f7cc6b3941 100644 --- a/system-settings/plugins/ifnet/plugin.c +++ b/system-settings/plugins/ifnet/plugin.c @@ -182,10 +182,10 @@ monitor_file_changes (const char *filename, return monitor; } -/* Callback for nm_sysconfig_connection_replace_and_commit. Report any errors +/* Callback for nm_settings_connection_replace_and_commit. Report any errors * encountered when commiting connection settings updates. */ static void -commit_cb (NMSysconfigConnection *connection, GError *error, gpointer unused) +commit_cb (NMSettingsConnection *connection, GError *error, gpointer unused) { if (error) { PLUGIN_WARN (IFNET_PLUGIN_NAME, " error updating: %s", @@ -287,7 +287,7 @@ reload_connections (gpointer config) PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Auto refreshing %s", conn_name); /* Remove and re-add to disconnect and reconnect with new settings */ - g_signal_emit_by_name (old, NM_SYSCONFIG_CONNECTION_REMOVED); + g_signal_emit_by_name (old, NM_SETTINGS_CONNECTION_REMOVED); g_hash_table_remove (priv->config_connections, conn_name); g_hash_table_insert (priv->config_connections, g_strdup (conn_name), new); if (is_managed (conn_name)) @@ -295,9 +295,9 @@ reload_connections (gpointer config) } } else { /* Update existing connection with new settings */ - nm_sysconfig_connection_replace_and_commit (NM_SYSCONFIG_CONNECTION (old), - NM_CONNECTION (new), - commit_cb, NULL); + nm_settings_connection_replace_and_commit (NM_SETTINGS_CONNECTION (old), + NM_CONNECTION (new), + commit_cb, NULL); g_object_unref (new); } g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); @@ -313,7 +313,7 @@ reload_connections (gpointer config) g_hash_table_iter_init (&iter, priv->config_connections); while (g_hash_table_iter_next (&iter, &key, &value)) { if (!g_hash_table_lookup (new_conn_names, key)) { - g_signal_emit_by_name (value, NM_SYSCONFIG_CONNECTION_REMOVED); + g_signal_emit_by_name (value, NM_SETTINGS_CONNECTION_REMOVED); g_hash_table_remove (priv->config_connections, key); } } @@ -321,7 +321,7 @@ reload_connections (gpointer config) g_list_free (conn_names); } -static NMSysconfigConnection * +static NMSettingsConnection * add_connection (NMSystemConfigInterface *config, NMConnection *source, GError **error) @@ -333,7 +333,7 @@ add_connection (NMSystemConfigInterface *config, if (conn_name) connection = nm_ifnet_connection_new (conn_name, source); reload_connections (config); - return connection ? NM_SYSCONFIG_CONNECTION (connection) : NULL; + return connection ? NM_SETTINGS_CONNECTION (connection) : NULL; } static void diff --git a/system-settings/plugins/ifupdown/nm-ifupdown-connection.c b/system-settings/plugins/ifupdown/nm-ifupdown-connection.c index 17d250c28e..0cc73b34f6 100644 --- a/system-settings/plugins/ifupdown/nm-ifupdown-connection.c +++ b/system-settings/plugins/ifupdown/nm-ifupdown-connection.c @@ -26,13 +26,13 @@ #include #include #include -#include +#include #include #include #include "nm-ifupdown-connection.h" #include "parser.h" -G_DEFINE_TYPE (NMIfupdownConnection, nm_ifupdown_connection, NM_TYPE_SYSCONFIG_CONNECTION) +G_DEFINE_TYPE (NMIfupdownConnection, nm_ifupdown_connection, NM_TYPE_SETTINGS_CONNECTION) #define NM_IFUPDOWN_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IFUPDOWN_CONNECTION, NMIfupdownConnectionPrivate)) @@ -58,7 +58,7 @@ nm_ifupdown_connection_new (if_block *block) } static gboolean -supports_secrets (NMSysconfigConnection *connection, const char *setting_name) +supports_secrets (NMSettingsConnection *connection, const char *setting_name) { PLUGIN_PRINT ("SCPlugin-Ifupdown", "supports_secrets() for setting_name: '%s'", setting_name); @@ -146,7 +146,7 @@ static void nm_ifupdown_connection_class_init (NMIfupdownConnectionClass *ifupdown_connection_class) { GObjectClass *object_class = G_OBJECT_CLASS (ifupdown_connection_class); - NMSysconfigConnectionClass *connection_class = NM_SYSCONFIG_CONNECTION_CLASS (ifupdown_connection_class); + NMSettingsConnectionClass *connection_class = NM_SETTINGS_CONNECTION_CLASS (ifupdown_connection_class); g_type_class_add_private (ifupdown_connection_class, sizeof (NMIfupdownConnectionPrivate)); diff --git a/system-settings/plugins/ifupdown/nm-ifupdown-connection.h b/system-settings/plugins/ifupdown/nm-ifupdown-connection.h index 2aa74df6b7..510a4d56ab 100644 --- a/system-settings/plugins/ifupdown/nm-ifupdown-connection.h +++ b/system-settings/plugins/ifupdown/nm-ifupdown-connection.h @@ -24,7 +24,7 @@ #ifndef NM_IFUPDOWN_CONNECTION_H #define NM_IFUPDOWN_CONNECTION_H -#include +#include #include "interface_parser.h" G_BEGIN_DECLS @@ -39,11 +39,11 @@ G_BEGIN_DECLS #define NM_IFUPDOWN_CONNECTION_IFBLOCK "ifblock" typedef struct { - NMSysconfigConnection parent; + NMSettingsConnection parent; } NMIfupdownConnection; typedef struct { - NMSysconfigConnectionClass parent; + NMSettingsConnectionClass parent; } NMIfupdownConnectionClass; GType nm_ifupdown_connection_get_type (void); diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c index 389d6d9738..9944546cb5 100644 --- a/system-settings/plugins/ifupdown/plugin.c +++ b/system-settings/plugins/ifupdown/plugin.c @@ -179,7 +179,7 @@ sc_plugin_ifupdown_class_init (SCPluginIfupdownClass *req_class) } static void -ignore_cb (NMSysconfigConnection *connection, +ignore_cb (NMSettingsConnection *connection, GError *error, gpointer user_data) { @@ -229,9 +229,7 @@ bind_device_to_connection (SCPluginIfupdown *self, } g_byte_array_free (mac_address, TRUE); - nm_sysconfig_connection_commit_changes (NM_SYSCONFIG_CONNECTION (exported), - ignore_cb, - NULL); + nm_settings_connection_commit_changes (NM_SETTINGS_CONNECTION (exported), ignore_cb, NULL); } static void @@ -411,9 +409,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) exported = g_hash_table_lookup (priv->iface_connections, block->name); if (exported) { PLUGIN_PRINT("SCPlugin-Ifupdown", "deleting %s from iface_connections", block->name); - nm_sysconfig_connection_delete (NM_SYSCONFIG_CONNECTION (exported), - ignore_cb, - NULL); + nm_settings_connection_delete (NM_SETTINGS_CONNECTION (exported), ignore_cb, NULL); g_hash_table_remove (priv->iface_connections, block->name); } @@ -446,9 +442,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) setting = NM_SETTING (nm_connection_get_setting (NM_CONNECTION (exported), NM_TYPE_SETTING_CONNECTION)); g_object_set (setting, NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, NULL); - nm_sysconfig_connection_commit_changes (NM_SYSCONFIG_CONNECTION (exported), - ignore_cb, - NULL); + nm_settings_connection_commit_changes (NM_SETTINGS_CONNECTION (exported), ignore_cb, NULL); PLUGIN_PRINT("SCPlugin-Ifupdown", "autoconnect"); } @@ -507,7 +501,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) for (cl_iter = con_list; cl_iter; cl_iter = g_list_next (cl_iter)) { g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, - NM_SYSCONFIG_CONNECTION (cl_iter->data)); + NM_SETTINGS_CONNECTION (cl_iter->data)); } g_list_free (con_list); } diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c index 5368464ef8..2e9aa0fb5b 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.c +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 - 2010 Red Hat, Inc. + * Copyright (C) 2008 - 2011 Red Hat, Inc. */ #include @@ -32,7 +32,7 @@ #include "writer.h" #include "common.h" -G_DEFINE_TYPE (NMKeyfileConnection, nm_keyfile_connection, NM_TYPE_SYSCONFIG_CONNECTION) +G_DEFINE_TYPE (NMKeyfileConnection, nm_keyfile_connection, NM_TYPE_SETTINGS_CONNECTION) #define NM_KEYFILE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionPrivate)) @@ -69,7 +69,7 @@ nm_keyfile_connection_new (const char *full_path, priv->path = g_strdup (full_path); /* Update our settings with what was read from the file */ - if (!nm_sysconfig_connection_replace_settings (NM_SYSCONFIG_CONNECTION (object), tmp, error)) { + if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object), tmp, error)) { g_object_unref (object); object = NULL; goto out; @@ -109,8 +109,8 @@ nm_keyfile_connection_get_path (NMKeyfileConnection *self) } static void -commit_changes (NMSysconfigConnection *connection, - NMSysconfigConnectionCommitFunc callback, +commit_changes (NMSettingsConnection *connection, + NMSettingsConnectionCommitFunc callback, gpointer user_data) { NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (connection); @@ -130,23 +130,23 @@ commit_changes (NMSysconfigConnection *connection, } else g_free (path); - NM_SYSCONFIG_CONNECTION_CLASS (nm_keyfile_connection_parent_class)->commit_changes (connection, - callback, - user_data); + NM_SETTINGS_CONNECTION_CLASS (nm_keyfile_connection_parent_class)->commit_changes (connection, + callback, + user_data); } static void -do_delete (NMSysconfigConnection *connection, - NMSysconfigConnectionDeleteFunc callback, +do_delete (NMSettingsConnection *connection, + NMSettingsConnectionDeleteFunc callback, gpointer user_data) { NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (connection); g_unlink (priv->path); - NM_SYSCONFIG_CONNECTION_CLASS (nm_keyfile_connection_parent_class)->delete (connection, - callback, - user_data); + NM_SETTINGS_CONNECTION_CLASS (nm_keyfile_connection_parent_class)->delete (connection, + callback, + user_data); } /* GObject */ @@ -172,12 +172,12 @@ static void nm_keyfile_connection_class_init (NMKeyfileConnectionClass *keyfile_connection_class) { GObjectClass *object_class = G_OBJECT_CLASS (keyfile_connection_class); - NMSysconfigConnectionClass *sysconfig_class = NM_SYSCONFIG_CONNECTION_CLASS (keyfile_connection_class); + NMSettingsConnectionClass *settings_class = NM_SETTINGS_CONNECTION_CLASS (keyfile_connection_class); g_type_class_add_private (keyfile_connection_class, sizeof (NMKeyfileConnectionPrivate)); /* Virtual methods */ object_class->finalize = finalize; - sysconfig_class->commit_changes = commit_changes; - sysconfig_class->delete = do_delete; + settings_class->commit_changes = commit_changes; + settings_class->delete = do_delete; } diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.h b/system-settings/plugins/keyfile/nm-keyfile-connection.h index ab7b42eaa2..bf64e69a3a 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.h +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.h @@ -16,13 +16,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2011 Red Hat, Inc. */ #ifndef NM_KEYFILE_CONNECTION_H #define NM_KEYFILE_CONNECTION_H -#include +#include G_BEGIN_DECLS @@ -34,11 +34,11 @@ G_BEGIN_DECLS #define NM_KEYFILE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionClass)) typedef struct { - NMSysconfigConnection parent; + NMSettingsConnection parent; } NMKeyfileConnection; typedef struct { - NMSysconfigConnectionClass parent; + NMSettingsConnectionClass parent; } NMKeyfileConnectionClass; GType nm_keyfile_connection_get_type (void); diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c index 27ddb299fd..819b809714 100644 --- a/system-settings/plugins/keyfile/plugin.c +++ b/system-settings/plugins/keyfile/plugin.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 - 2010 Red Hat, Inc. + * Copyright (C) 2008 - 2011 Red Hat, Inc. */ #include @@ -69,7 +69,7 @@ typedef struct { gboolean disposed; } SCPluginKeyfilePrivate; -static NMSysconfigConnection * +static NMSettingsConnection * _internal_new_connection (SCPluginKeyfile *self, const char *full_path, NMConnection *source, @@ -102,7 +102,7 @@ _internal_new_connection (SCPluginKeyfile *self, if (out_cid) *out_cid = cid; - return NM_SYSCONFIG_CONNECTION (connection); + return NM_SETTINGS_CONNECTION (connection); } static void @@ -124,7 +124,7 @@ read_connections (NMSystemConfigInterface *config) } while ((item = g_dir_read_name (dir))) { - NMSysconfigConnection *connection; + NMSettingsConnection *connection; char *full_path; if (utils_should_ignore_file (item)) @@ -147,7 +147,7 @@ read_connections (NMSystemConfigInterface *config) } static void -update_connection_settings_commit_cb (NMSysconfigConnection *orig, GError *error, gpointer user_data) +update_connection_settings_commit_cb (NMSettingsConnection *orig, GError *error, gpointer user_data) { if (error) { g_warning ("%s: '%s' / '%s' invalid: %d", @@ -165,9 +165,9 @@ static void update_connection_settings (NMKeyfileConnection *orig, NMKeyfileConnection *new) { - nm_sysconfig_connection_replace_and_commit (NM_SYSCONFIG_CONNECTION (orig), - NM_CONNECTION (new), - update_connection_settings_commit_cb, NULL); + nm_settings_connection_replace_and_commit (NM_SETTINGS_CONNECTION (orig), + NM_CONNECTION (new), + update_connection_settings_commit_cb, NULL); } /* Monitoring */ @@ -406,13 +406,13 @@ get_connections (NMSystemConfigInterface *config) return list; } -static NMSysconfigConnection * +static NMSettingsConnection * add_connection (NMSystemConfigInterface *config, NMConnection *connection, GError **error) { SCPluginKeyfile *self = SC_PLUGIN_KEYFILE (config); - NMSysconfigConnection *added = NULL; + NMSettingsConnection *added = NULL; char *path = NULL; /* Write it out first, then add the connection to our internal list */