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-26 19:35:26 +0200
commit987c584bb5dabd673c4d75e93ab487d0a379bfc4 (patch)
treeccfcc0180182a0629708dbee5e2e370096a1d25e
parent640736ff65059bbe29ae7fa273015d849c78092a (diff)
downloadNetworkManager-987c584bb5dabd673c4d75e93ab487d0a379bfc4.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,