[network-manager-applet/nm-1-4] all: propagate type for g_object_ref() and fix pointer types
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nm-1-4] all: propagate type for g_object_ref() and fix pointer types
- Date: Fri, 1 Jun 2018 10:04:17 +0000 (UTC)
commit 41666a43f45a111c6bd7364b62b86415da2c62cd
Author: Thomas Haller <thaller redhat com>
Date: Thu Dec 21 10:01:30 2017 +0100
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)
shared/nm-utils/nm-glib.h | 5 +++++
src/applet-device-broadband.c | 2 +-
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]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]