summaryrefslogtreecommitdiffstats
path: root/network/connection.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/connection.c
parente8db465169591d3f77056294699c30113fe5206a (diff)
Use dbus_connection_emit_signal to emit signals.
Diffstat (limited to 'network/connection.c')
-rw-r--r--network/connection.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/network/connection.c b/network/connection.c
index cd963dad..d565fea2 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -79,13 +79,12 @@ static gboolean bnep_watchdog_cb(GIOChannel *chan, GIOCondition cond,
gpointer data)
{
struct network_conn *nc = data;
- DBusMessage *signal;
if (nc->conn != NULL) {
- signal = dbus_message_new_signal(nc->path,
- NETWORK_CONNECTION_INTERFACE, "Disconnected");
-
- send_message_and_unref(nc->conn, signal);
+ dbus_connection_emit_signal(nc->conn, nc->path,
+ NETWORK_CONNECTION_INTERFACE,
+ "Disconnected",
+ DBUS_TYPE_INVALID);
}
info("%s disconnected", nc->dev);
nc->state = DISCONNECTED;
@@ -103,7 +102,7 @@ static gboolean bnep_connect_cb(GIOChannel *chan, GIOCondition cond,
char pkt[BNEP_MTU];
gsize r;
int sk;
- DBusMessage *reply, *signal;
+ DBusMessage *reply;
const char *pdev;
if (cond & G_IO_NVAL)
@@ -157,11 +156,10 @@ static gboolean bnep_connect_cb(GIOChannel *chan, GIOCondition cond,
}
bnep_if_up(nc->dev, TRUE);
-
- signal = dbus_message_new_signal(nc->path,
- NETWORK_CONNECTION_INTERFACE, "Connected");
-
- send_message_and_unref(nc->conn, signal);
+ dbus_connection_emit_signal(nc->conn, nc->path,
+ NETWORK_CONNECTION_INTERFACE,
+ "Connected",
+ DBUS_TYPE_INVALID);
reply = dbus_message_new_method_return(nc->msg);