summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-08-13 14:34:29 -0400
committerDan Winship <danw@gnome.org>2014-08-16 10:17:53 -0400
commit470937586cfa1fc5c05a9bb00b130ceee22ebadc (patch)
treea70fc1d7815f244e9b17388a17711df155ed9bda /examples
parentfce989e5328e594606456ae2a3f795880a4e81ca (diff)
libnm-core, libnm, core: make NMConnection an interface
The fact that NMRemoteConnection has to be an NMConnection and therefore can't be an NMObject means that it needs to reimplement bits of NMObject functionality (and likewise NMObject needs some special magic to deal with it). Likewise, we will need a daemon-side equivalent of NMObject as part of the gdbus port, and we would want NMSettingsConnection to be able to inherit from this as well. Solve this problem by making NMConnection into an interface, and having NMRemoteConnection and NMSettingsConnection implement it. (We use some hacks to keep the GHashTable of NMSettings objects inside nm-connection.c rather than having to be implemented by the implementations.) Since NMConnection is no longer an instantiable type, this adds NMSimpleConnection to replace the various non-D-Bus-based uses of NMConnection throughout the code. nm_connection_new() becomes nm_simple_connection_new(), nm_connection_new_from_hash() becomes nm_simple_connection_new_from_hash(), and nm_connection_duplicate() becomes nm_simple_connection_new_clone().
Diffstat (limited to 'examples')
-rw-r--r--examples/C/glib/add-connection-dbus-glib.c2
-rw-r--r--examples/C/glib/add-connection-libnm.c2
-rw-r--r--examples/C/glib/get-active-connections-dbus-glib.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/C/glib/add-connection-dbus-glib.c b/examples/C/glib/add-connection-dbus-glib.c
index a50e8ba6c..beb0beca4 100644
--- a/examples/C/glib/add-connection-dbus-glib.c
+++ b/examples/C/glib/add-connection-dbus-glib.c
@@ -46,7 +46,7 @@ add_connection (DBusGProxy *proxy, const char *con_name)
GError *error = NULL;
/* Create a new connection object */
- connection = (NMConnection *) nm_connection_new ();
+ connection = (NMConnection *) nm_simple_connection_new ();
/* Build up the 'connection' Setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
diff --git a/examples/C/glib/add-connection-libnm.c b/examples/C/glib/add-connection-libnm.c
index 59a51ba20..f390bfa15 100644
--- a/examples/C/glib/add-connection-libnm.c
+++ b/examples/C/glib/add-connection-libnm.c
@@ -62,7 +62,7 @@ add_connection (NMRemoteSettings *settings, GMainLoop *loop, const char *con_nam
gboolean success;
/* Create a new connection object */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Build up the 'connection' Setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
diff --git a/examples/C/glib/get-active-connections-dbus-glib.c b/examples/C/glib/get-active-connections-dbus-glib.c
index 65df85b51..0e81ca9c1 100644
--- a/examples/C/glib/get-active-connections-dbus-glib.c
+++ b/examples/C/glib/get-active-connections-dbus-glib.c
@@ -66,7 +66,7 @@ print_connection (DBusGConnection *bus, const char *path)
/* Using the raw configuration, create an NMConnection object for it. This
* step also verifies that the data we got from NetworkManager are valid. */
- connection = nm_connection_new_from_hash (hash, &error);
+ connection = nm_simple_connection_new_from_hash (hash, &error);
if (!connection) {
g_warning ("Received invalid connection data: %s", error->message);
g_error_free (error);