diff options
author | Thomas Haller <thaller@redhat.com> | 2017-12-21 10:01:30 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2018-06-01 12:01:44 +0200 |
commit | 41666a43f45a111c6bd7364b62b86415da2c62cd (patch) | |
tree | e019729b8a7523dfee8e317e5bf88a6b233c4967 | |
parent | 47a4b51e52e7cbb52f09dd274acdb937b969d3f2 (diff) | |
download | network-manager-applet-41666a43f45a111c6bd7364b62b86415da2c62cd.tar.gz |
all: propagate type for g_object_ref() and fix pointer types
See related bug https://bugzilla.gnome.org/show_bug.cgi?id=790697.
This was introduced by NetworkManager commit 7ca601d529329f756340961fcd153399b2f5063c.
(cherry picked from commit 848cef051ffb28db4ad97df21bf1127e4fda9ea6)
-rw-r--r-- | shared/nm-utils/nm-glib.h | 5 | ||||
-rw-r--r-- | src/applet-device-broadband.c | 2 | ||||
-rw-r--r-- | src/applet-device-wifi.c | 10 |
3 files changed, 11 insertions, 6 deletions
diff --git a/shared/nm-utils/nm-glib.h b/shared/nm-utils/nm-glib.h index 824a08ca..2931e7ab 100644 --- a/shared/nm-utils/nm-glib.h +++ b/shared/nm-utils/nm-glib.h @@ -449,4 +449,9 @@ _nm_g_variant_new_take_string (gchar *string) } #define g_variant_new_take_string _nm_g_variant_new_take_string +#if !GLIB_CHECK_VERSION (2, 56, 0) +#define g_object_ref(Obj) ((typeof(Obj)) g_object_ref (Obj)) +#define g_object_ref_sink(Obj) ((typeof(Obj)) g_object_ref_sink (Obj)) +#endif + #endif /* __NM_GLIB_H__ */ diff --git a/src/applet-device-broadband.c b/src/applet-device-broadband.c index 4929d34a..e087d185 100644 --- a/src/applet-device-broadband.c +++ b/src/applet-device-broadband.c @@ -698,7 +698,7 @@ add_connection_item (NMDevice *device, info = g_slice_new0 (BroadbandMenuItemInfo); info->applet = applet; - info->device = g_object_ref (G_OBJECT (device)); + info->device = g_object_ref (device); info->connection = connection ? g_object_ref (connection) : NULL; g_signal_connect_data (item, "activate", diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c index cd44e05a..949832fa 100644 --- a/src/applet-device-wifi.c +++ b/src/applet-device-wifi.c @@ -645,9 +645,9 @@ create_new_ap_item (NMDeviceWifi *device, info = g_slice_new0 (WifiMenuItemInfo); info->applet = applet; - info->device = g_object_ref (G_OBJECT (device)); - info->ap = g_object_ref (G_OBJECT (ap)); - info->connection = g_object_ref (G_OBJECT (connection)); + info->device = g_object_ref (device); + info->ap = g_object_ref (ap); + info->connection = g_object_ref (connection); g_signal_connect_data (subitem, "activate", G_CALLBACK (wifi_menu_item_activate), @@ -663,8 +663,8 @@ create_new_ap_item (NMDeviceWifi *device, info = g_slice_new0 (WifiMenuItemInfo); info->applet = applet; - info->device = g_object_ref (G_OBJECT (device)); - info->ap = g_object_ref (G_OBJECT (ap)); + info->device = g_object_ref (device); + info->ap = g_object_ref (ap); if (ap_connections->len == 1) { connection = NM_CONNECTION (ap_connections->pdata[0]); |