summaryrefslogtreecommitdiffstats
path: root/network/manager.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-05-09 19:59:18 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-05-09 19:59:18 +0000
commitbec9d1838bc0bf9e8ee21f452b6e0431a3abe0bf (patch)
treedf7fb343867fadf3164ac09a911952026613b4fe /network/manager.c
parente8db465169591d3f77056294699c30113fe5206a (diff)
Use dbus_connection_emit_signal to emit signals.
Diffstat (limited to 'network/manager.c')
-rw-r--r--network/manager.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/network/manager.c b/network/manager.c
index 07f30d46..b61233c9 100644
--- a/network/manager.c
+++ b/network/manager.c
@@ -94,18 +94,14 @@ static DBusHandlerResult create_path(DBusConnection *conn,
DBusMessage *msg, const char *path,
const char *sname)
{
- DBusMessage *reply, *signal;
+ DBusMessage *reply;
/* emit signal when it is a new path */
if (sname) {
- signal = dbus_message_new_signal(NETWORK_PATH,
- NETWORK_MANAGER_INTERFACE, sname);
-
- dbus_message_append_args(signal,
- DBUS_TYPE_STRING, &path,
- DBUS_TYPE_INVALID);
-
- send_message_and_unref(conn, signal);
+ dbus_connection_emit_signal(conn, NETWORK_PATH,
+ NETWORK_MANAGER_INTERFACE,
+ sname, DBUS_TYPE_STRING, &path,
+ DBUS_TYPE_INVALID);
}
reply = dbus_message_new_method_return(msg);
@@ -148,7 +144,7 @@ static DBusHandlerResult remove_path(DBusConnection *conn,
const char *sname)
{
const char *path;
- DBusMessage *reply, *signal;
+ DBusMessage *reply;
DBusError derr;
GSList *l;
@@ -180,14 +176,10 @@ static DBusHandlerResult remove_path(DBusConnection *conn,
if (!dbus_connection_destroy_object_path(conn, path))
error("Network path unregister failed");
- signal = dbus_message_new_signal(NETWORK_PATH,
- NETWORK_MANAGER_INTERFACE, sname);
-
- dbus_message_append_args(signal,
- DBUS_TYPE_STRING, &path,
- DBUS_TYPE_INVALID);
-
- send_message_and_unref(conn, signal);
+ dbus_connection_emit_signal(conn, NETWORK_PATH,
+ NETWORK_MANAGER_INTERFACE,
+ sname, DBUS_TYPE_STRING, &path,
+ DBUS_TYPE_INVALID);
return send_message_and_unref(conn, reply);
}