summaryrefslogtreecommitdiff
path: root/shared/nm-utils/nm-shared-utils.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-09-07 17:56:38 +0200
committerThomas Haller <thaller@redhat.com>2017-09-07 18:10:06 +0200
commit19716df23ddfd3047b64620c389fa336e4427c69 (patch)
treef1e7e37bd0ec56319cf05d49d107eaa7bc96090b /shared/nm-utils/nm-shared-utils.c
parentac5350fef242e08f3056414be4c86e6d14718cf3 (diff)
downloadNetworkManager-19716df23ddfd3047b64620c389fa336e4427c69.tar.gz
shared: add nm_g_object_class_find_property_from_gtype() util
And relax the type for nm_auto_unref_gtypeclass macro. Like g_type_class_unref() itself, you usually don't use it with a GTypeClass base class, but some subtype like GObjectClass.
Diffstat (limited to 'shared/nm-utils/nm-shared-utils.c')
-rw-r--r--shared/nm-utils/nm-shared-utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/shared/nm-utils/nm-shared-utils.c b/shared/nm-utils/nm-shared-utils.c
index b512e52a57..0109818a19 100644
--- a/shared/nm-utils/nm-shared-utils.c
+++ b/shared/nm-utils/nm-shared-utils.c
@@ -528,6 +528,16 @@ nm_g_object_set_property (GObject *object,
return TRUE;
}
+GParamSpec *
+nm_g_object_class_find_property_from_gtype (GType gtype,
+ const char *property_name)
+{
+ nm_auto_unref_gtypeclass GObjectClass *gclass = NULL;
+
+ gclass = g_type_class_ref (gtype);
+ return g_object_class_find_property (gclass, property_name);
+}
+
/*****************************************************************************/
static void