diff options
Diffstat (limited to 'examples/C')
| -rw-r--r-- | examples/C/glib/add-connection-gdbus.c | 5 | ||||
| -rw-r--r-- | examples/C/glib/add-connection-libnm.c | 5 | ||||
| -rw-r--r-- | examples/C/glib/get-active-connections-gdbus.c | 5 | ||||
| -rw-r--r-- | examples/C/glib/get-ap-info-libnm.c | 9 | ||||
| -rw-r--r-- | examples/C/glib/list-connections-gdbus.c | 5 | ||||
| -rw-r--r-- | examples/C/glib/list-connections-libnm.c | 5 | ||||
| -rw-r--r-- | examples/C/glib/meson.build | 19 | ||||
| -rw-r--r-- | examples/C/glib/monitor-nm-running-gdbus.c | 5 | ||||
| -rw-r--r-- | examples/C/glib/monitor-nm-state-gdbus.c | 5 | ||||
| -rw-r--r-- | examples/C/qt/meson.build | 47 |
10 files changed, 42 insertions, 68 deletions
diff --git a/examples/C/glib/add-connection-gdbus.c b/examples/C/glib/add-connection-gdbus.c index 1045db38..7c8edf68 100644 --- a/examples/C/glib/add-connection-gdbus.c +++ b/examples/C/glib/add-connection-gdbus.c @@ -124,6 +124,11 @@ main (int argc, char *argv[]) GDBusProxy *proxy; GError *error = NULL; +#if !GLIB_CHECK_VERSION (2, 35, 0) + /* Initialize GType system */ + g_type_init (); +#endif + /* Create a D-Bus proxy; NM_DBUS_* defined in nm-dbus-interface.h */ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, diff --git a/examples/C/glib/add-connection-libnm.c b/examples/C/glib/add-connection-libnm.c index 18b3d680..86915ea2 100644 --- a/examples/C/glib/add-connection-libnm.c +++ b/examples/C/glib/add-connection-libnm.c @@ -105,6 +105,11 @@ main (int argc, char *argv[]) GMainLoop *loop; GError *error = NULL; +#if !GLIB_CHECK_VERSION (2, 35, 0) + /* Initialize GType system */ + g_type_init (); +#endif + loop = g_main_loop_new (NULL, FALSE); /* Connect to NetworkManager */ diff --git a/examples/C/glib/get-active-connections-gdbus.c b/examples/C/glib/get-active-connections-gdbus.c index 033582fb..217fd7ac 100644 --- a/examples/C/glib/get-active-connections-gdbus.c +++ b/examples/C/glib/get-active-connections-gdbus.c @@ -251,6 +251,11 @@ main (int argc, char *argv[]) { GDBusProxy *props_proxy; +#if !GLIB_CHECK_VERSION (2, 35, 0) + /* Initialize GType system */ + g_type_init (); +#endif + /* Create a D-Bus proxy to get the object properties from the NM Manager * object. NM_DBUS_* defines are from nm-dbus-interface.h. */ diff --git a/examples/C/glib/get-ap-info-libnm.c b/examples/C/glib/get-ap-info-libnm.c index b312356c..a548d12d 100644 --- a/examples/C/glib/get-ap-info-libnm.c +++ b/examples/C/glib/get-ap-info-libnm.c @@ -79,7 +79,7 @@ show_access_point_info (NMAccessPoint *ap) { guint32 flags, wpa_flags, rsn_flags, freq, bitrate; guint8 strength; - GBytes *ssid; + GBytes *ssid; const char *hwaddr; NM80211Mode mode; char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str; @@ -158,7 +158,7 @@ show_wifi_device_info (NMDevice *device) const char *iface; const char *driver; guint32 speed; - GBytes *active_ssid; + GBytes *active_ssid; char *active_ssid_str = NULL; int i; @@ -202,6 +202,11 @@ main (int argc, char *argv[]) int i; GError *error = NULL; +#if !GLIB_CHECK_VERSION (2, 35, 0) + /* Initialize GType system */ + g_type_init (); +#endif + /* Get NMClient object */ client = nm_client_new (NULL, &error); if (!client) { diff --git a/examples/C/glib/list-connections-gdbus.c b/examples/C/glib/list-connections-gdbus.c index b8e77dc9..088df1d8 100644 --- a/examples/C/glib/list-connections-gdbus.c +++ b/examples/C/glib/list-connections-gdbus.c @@ -65,6 +65,11 @@ main (int argc, char *argv[]) { GDBusProxy *proxy; +#if !GLIB_CHECK_VERSION (2, 35, 0) + /* Initialize GType system */ + g_type_init (); +#endif + /* Create a D-Bus proxy; NM_DBUS_* defined in nm-dbus-interface.h */ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, diff --git a/examples/C/glib/list-connections-libnm.c b/examples/C/glib/list-connections-libnm.c index 1b3ed8d1..5dc38201 100644 --- a/examples/C/glib/list-connections-libnm.c +++ b/examples/C/glib/list-connections-libnm.c @@ -69,6 +69,11 @@ main (int argc, char *argv[]) const GPtrArray *connections; int i; +#if !GLIB_CHECK_VERSION (2, 35, 0) + /* Initialize GType system */ + g_type_init (); +#endif + if (!(client = nm_client_new (NULL, &error))) { g_message ("Error: Could not connect to NetworkManager: %s.", error->message); g_error_free (error); diff --git a/examples/C/glib/meson.build b/examples/C/glib/meson.build deleted file mode 100644 index edc4dbb1..00000000 --- a/examples/C/glib/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -examples = [ - ['add-connection-gdbus', [libnm_enum[1]], [libnm_inc], [uuid_dep]], - ['add-connection-libnm', [], [], [libnm_dep]], - ['get-active-connections-gdbus', [libnm_enum[1]], [libnm_inc], []], - ['get-ap-info-libnm', [], [], [libnm_dep]], - ['list-connections-gdbus', [], [], []], - ['list-connections-libnm', [], [], [libnm_dep]], - ['monitor-nm-running-gdbus', [], [], []], - ['monitor-nm-state-gdbus', [], [], []] -] - -foreach example: examples - executable( - example[0], - [example[0] + '.c'] + example[1], - include_directories: example[2], - dependencies: [nm_core_dep] + example[3], - ) -endforeach diff --git a/examples/C/glib/monitor-nm-running-gdbus.c b/examples/C/glib/monitor-nm-running-gdbus.c index 68617884..c19569b5 100644 --- a/examples/C/glib/monitor-nm-running-gdbus.c +++ b/examples/C/glib/monitor-nm-running-gdbus.c @@ -56,6 +56,11 @@ main (int argc, char *argv[]) GMainLoop *loop; GBusNameWatcherFlags flags; +#if !GLIB_CHECK_VERSION (2, 35, 0) + /* Initialize GType system */ + g_type_init (); +#endif + g_print ("Monitor 'org.freedesktop.NetworkManager' D-Bus name\n"); g_print ("===================================================\n"); diff --git a/examples/C/glib/monitor-nm-state-gdbus.c b/examples/C/glib/monitor-nm-state-gdbus.c index 204ff570..913644d2 100644 --- a/examples/C/glib/monitor-nm-state-gdbus.c +++ b/examples/C/glib/monitor-nm-state-gdbus.c @@ -90,6 +90,11 @@ main (int argc, char *argv[]) GDBusProxyFlags flags; GDBusProxy *proxy; +#if !GLIB_CHECK_VERSION (2, 35, 0) + /* Initialize GType system */ + g_type_init (); +#endif + /* Monitor 'StateChanged' signal on 'org.freedesktop.NetworkManager' interface */ g_print ("Monitor NetworkManager's state\n"); g_print ("==============================\n"); diff --git a/examples/C/qt/meson.build b/examples/C/qt/meson.build deleted file mode 100644 index d92205b1..00000000 --- a/examples/C/qt/meson.build +++ /dev/null @@ -1,47 +0,0 @@ -examples = [ - ['add-connection-wired', []], - ['list-connections', []], - ['change-ipv4-addresses', []] -] - -incs = [ - top_inc, - libnm_core_inc -] - -qt_core_dep = dependency('QtCore', version: '>= 4') - -deps = [ - dbus_dep, - dbus_glib_dep, - qt_core_dep, - dependency('QtDBus'), - dependency('QtNetwork') -] - -moc = find_program('moc-qt4', required: false) -if not moc.found() - moc = qt_core_dep.get_pkgconfig_variable('moc_location') -endif - -example = 'monitor-nm-running' -output = example + '.moc' - -example_moc = custom_target( - output, - input: example + '.cpp', - output: output, - command: [moc, '-i', '@INPUT@', '-o', '@OUTPUT@'] -) - -examples += [[example, [example_moc]]] - -foreach example: examples - executable( - example[0], - example[0] + '.cpp', - include_directories: incs, - dependencies: deps, - link_depends: example[1] - ) -endforeach |