summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-23 20:45:58 +0100
committerThomas Haller <thaller@redhat.com>2018-03-23 20:49:22 +0100
commit362c6d1c8a0b2cbd7ed2f46cbe961771a44f8216 (patch)
treeb4a475e5d9ec0178b5bad5e5e47404f871e42993
parentb2837c094a0b0e3cae5ee7ec546b9970631e9634 (diff)
downloadNetworkManager-362c6d1c8a0b2cbd7ed2f46cbe961771a44f8216.tar.gz
core/dbus: manually inline helper function to emit InterfacesAdded signal
-rw-r--r--src/nm-dbus-manager.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c
index 88fd9a40fd..70e17d1edc 100644
--- a/src/nm-dbus-manager.c
+++ b/src/nm-dbus-manager.c
@@ -110,9 +110,8 @@ NM_DEFINE_SINGLETON_GETTER (NMDBusManager, nm_dbus_manager_get, NM_TYPE_DBUS_MAN
static const GDBusInterfaceInfo interface_info_objmgr;
static const GDBusSignalInfo signal_info_objmgr_interfaces_added;
static const GDBusSignalInfo signal_info_objmgr_interfaces_removed;
-
-static void _objmgr_emit_interfaces_added (NMDBusManager *self,
- NMDBusObject *obj);
+static GVariantBuilder *_obj_collect_properties_all (NMDBusObject *obj,
+ GVariantBuilder *builder);
/*****************************************************************************/
@@ -927,6 +926,7 @@ _obj_register (NMDBusManager *self,
GType gtype;
NMDBusObjectClass *klasses[10];
const NMDBusInterfaceInfoExtended *const*prev_interface_infos = NULL;
+ GVariantBuilder builder;
nm_assert (c_list_is_empty (&obj->internal.registration_lst_head));
nm_assert (priv->connection);
@@ -1004,7 +1004,15 @@ _obj_register (NMDBusManager *self,
*
* In general, it's ok to export an object with frozen signals. But you better make sure
* that all properties are in a self-consistent state when exporting the object. */
- _objmgr_emit_interfaces_added (self, obj);
+ g_dbus_connection_emit_signal (priv->connection,
+ NULL,
+ OBJECT_MANAGER_SERVER_BASE_PATH,
+ interface_info_objmgr.name,
+ signal_info_objmgr_interfaces_added.name,
+ g_variant_new ("(oa{sa{sv}})",
+ obj->internal.path,
+ _obj_collect_properties_all (obj, &builder)),
+ NULL);
}
static void
@@ -1361,28 +1369,6 @@ _obj_collect_properties_all (NMDBusObject *obj,
}
static void
-_objmgr_emit_interfaces_added (NMDBusManager *self,
- NMDBusObject *obj)
-{
- NMDBusManagerPrivate *priv = NM_DBUS_MANAGER_GET_PRIVATE (self);
- GVariantBuilder builder;
-
- nm_assert (NM_IS_DBUS_OBJECT (obj));
- nm_assert (priv->connection);
- nm_assert (priv->objmgr_registration_id);
-
- g_dbus_connection_emit_signal (priv->connection,
- NULL,
- OBJECT_MANAGER_SERVER_BASE_PATH,
- interface_info_objmgr.name,
- signal_info_objmgr_interfaces_added.name,
- g_variant_new ("(oa{sa{sv}})",
- obj->internal.path,
- _obj_collect_properties_all (obj, &builder)),
- NULL);
-}
-
-static void
dbus_vtable_objmgr_method_call (GDBusConnection *connection,
const char *sender,
const char *object_path,