[maemo-commits] [maemo-commits] r13439 - in projects/haf/trunk/maemo-launcher: . launcher

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Aug 28 17:19:46 EEST 2007
Author: guillem
Date: 2007-08-28 17:19:45 +0300 (Tue, 28 Aug 2007)
New Revision: 13439

Modified:
   projects/haf/trunk/maemo-launcher/ChangeLog
   projects/haf/trunk/maemo-launcher/launcher/comm_dbus.c
Log:
Merge conn_dbus_init and conn_dbus_finish into comm_dbus_send_app_died.


Modified: projects/haf/trunk/maemo-launcher/ChangeLog
===================================================================
--- projects/haf/trunk/maemo-launcher/ChangeLog	2007-08-28 14:17:42 UTC (rev 13438)
+++ projects/haf/trunk/maemo-launcher/ChangeLog	2007-08-28 14:19:45 UTC (rev 13439)
@@ -1,5 +1,11 @@
 2007-08-28  Guillem Jover  <guillem.jover at nokia.com>
 
+	* launcher/comm_dbus.c (conn, comm_dbus_finish, comm_dbus_init): Merge
+	into ...
+	(comm_dbus_send_app_died): ... here.
+
+2007-08-28  Guillem Jover  <guillem.jover at nokia.com>
+
 	* launcher/comm_dbus.c (comm_dbus_finish): Do not call dbus_shutdown,
 	as libdbus is too eager throwing abort(3) around.
 

Modified: projects/haf/trunk/maemo-launcher/launcher/comm_dbus.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/comm_dbus.c	2007-08-28 14:17:42 UTC (rev 13438)
+++ projects/haf/trunk/maemo-launcher/launcher/comm_dbus.c	2007-08-28 14:19:45 UTC (rev 13439)
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) 2006 Nokia Corporation
+ * Copyright (C) 2006, 2007 Nokia Corporation
  *
  * Author: Guillem Jover <guillem.jover at nokia.com>
  *
@@ -27,33 +27,16 @@
 #include "comm_dbus.h"
 #include "report.h"
 
-static DBusConnection *conn = NULL;
-
 static void
-comm_dbus_init(void)
+comm_dbus_send_app_died(char *filename, int pid, int status)
 {
+  DBusConnection *conn;
+  DBusMessage *msg;
+
   conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
   if (conn == NULL)
-  {
     die(1, "%s: getting dbus bus\n", __FUNCTION__);
-  }
-}
 
-static void
-comm_dbus_finish(void)
-{
-  dbus_connection_unref(conn);
-  conn = NULL;
-}
-
-static void
-comm_dbus_send_app_died(char *filename, int pid, int status)
-{
-  DBusMessage *msg;
-
-  if (!conn)
-    comm_dbus_init();
-
   msg = dbus_message_new_signal(LAUNCHER_PATH,
 				LAUNCHER_IFACE,
 				LAUNCHER_SIGNAL_APP_DIED);
@@ -72,7 +55,8 @@
   dbus_connection_flush(conn);
   dbus_message_unref(msg);
 
-  comm_dbus_finish();
+  dbus_connection_unref(conn);
+  conn = NULL;
 }
 
 void


More information about the maemo-commits mailing list