about summary refs log tree commit diff
path: root/libnm/nm-object.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-04-11 21:30:33 +0200
committerMichael Biebl <biebl@debian.org>2020-04-11 21:30:33 +0200
commitf914c41532a9e4f2bb44be074466b62e4cac8db3 (patch)
tree046e8e7a186afecf299cd80d62fa1c93903dbecf /libnm/nm-object.c
parent19e73abd360f0198f94ce49f36ddf009056f6324 (diff)
parent1e5977b62f896e844b548c3007ace9e1dfa7f9ed (diff)
Update upstream source from tag 'upstream/1.23.90'
Update to upstream version '1.23.90'
with Debian dir 38c3873648b51c73a9e448ccb2ac18152c2b3f85
Diffstat (limited to 'libnm/nm-object.c')
-rw-r--r--libnm/nm-object.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/libnm/nm-object.c b/libnm/nm-object.c
index 89dc8bb3..d8c4fb41 100644
--- a/libnm/nm-object.c
+++ b/libnm/nm-object.c
@@ -78,13 +78,40 @@ _nm_object_get_client (gpointer self)
  *
  * Returns: the object's path. This is the internal string used by the
  * object, and must not be modified.
+ *
+ * Note that the D-Bus path of an NMObject never changes, even
+ * if the instance gets removed from the cache. To find out
+ * whether the object is still alive/cached, check nm_object_get_client().
  **/
 const char *
 nm_object_get_path (NMObject *object)
 {
 	g_return_val_if_fail (NM_IS_OBJECT (object), NULL);
 
-	return NM_OBJECT_GET_PRIVATE (object)->dbobj->dbus_path->str;
+	return _nm_object_get_path (object);
+}
+
+/**
+ * nm_object_get_client:
+ * @object: a #NMObject
+ *
+ * Returns the #NMClient instance in which object is cached.
+ * Also, if the object got removed from the client cached,
+ * this returns %NULL. So it can be used to check whether the
+ * object is still alive.
+ *
+ * Returns: (transfer none): the #NMClient cache in which the
+ * object can be found, or %NULL if the object is no longer
+ * cached.
+ *
+ * Since: 1.24
+ **/
+NMClient *
+nm_object_get_client (NMObject *object)
+{
+	g_return_val_if_fail (NM_IS_OBJECT (object), NULL);
+
+	return _nm_object_get_client (object);
 }
 
 /*****************************************************************************/