[evolution] Bug #659756 - Initialize dbus-glib threading for GConf



commit ea6e3bd0d5b1f4aadb71719d96ec9c88c8520ac9
Author: Milan Crha <mcrha redhat com>
Date:   Fri Mar 16 16:17:27 2012 +0100

    Bug #659756 - Initialize dbus-glib threading for GConf

 calendar/alarm-notify/Makefile.am   |    2 ++
 calendar/alarm-notify/notify-main.c |    5 +++++
 configure.ac                        |    9 +++++++++
 shell/Makefile.am                   |    2 ++
 shell/main.c                        |    5 +++++
 5 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/calendar/alarm-notify/Makefile.am b/calendar/alarm-notify/Makefile.am
index 5647c39..6de36d0 100644
--- a/calendar/alarm-notify/Makefile.am
+++ b/calendar/alarm-notify/Makefile.am
@@ -21,6 +21,7 @@ evolution_alarm_notify_CPPFLAGS = 			\
 	$(EVOLUTION_DATA_SERVER_CFLAGS)			\
 	$(GNOME_PLATFORM_CFLAGS)			\
 	$(LIBNOTIFY_CFLAGS)				\
+	$(DBUS_GLIB_CFLAGS)				\
 	$(CANBERRA_CFLAGS)
 
 ui_DATA =		\
@@ -49,6 +50,7 @@ evolution_alarm_notify_LDADD =						\
 	$(EVOLUTION_DATA_SERVER_LIBS)					\
 	$(GNOME_PLATFORM_LIBS)						\
 	$(LIBNOTIFY_LIBS)						\
+	$(DBUS_GLIB_LIBS)						\
 	$(CANBERRA_LIBS)						\
 	$(EVOLUTIONALARMNOTIFYICON)
 
diff --git a/calendar/alarm-notify/notify-main.c b/calendar/alarm-notify/notify-main.c
index a6d9d53..c0d8d72 100644
--- a/calendar/alarm-notify/notify-main.c
+++ b/calendar/alarm-notify/notify-main.c
@@ -30,6 +30,8 @@
 #include <stdlib.h>
 #include <glib/gi18n.h>
 
+#include <dbus/dbus-glib.h>
+
 #include <libedataserver/e-gdbus-templates.h>
 
 #include "alarm-notify.h"
@@ -84,6 +86,9 @@ main (gint argc,
 
 	gtk_init (&argc, &argv);
 
+	/* this is to initialize threading for dbus-glib used by GConf */
+	dbus_g_thread_init ();
+
 	e_gdbus_templates_init_main_thread ();
 
 #ifdef G_OS_WIN32
diff --git a/configure.ac b/configure.ac
index 1dc8125..feede83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -266,6 +266,15 @@ AC_SUBST(EVOLUTION_DATA_SERVER_CFLAGS)
 AC_SUBST(EVOLUTION_DATA_SERVER_LIBS)
 
 dnl ******************************
+dnl DBus-glib stuff, to initialize thread for GConf, which is using it
+dnl this is returned back only temporarily and wil lbe removed as soon
+dnl as eds will stop using GConf completely
+dnl ******************************
+PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.6)
+AC_SUBST(DBUS_GLIB_CFLAGS)
+AC_SUBST(DBUS_GLIB_LIBS)
+
+dnl ******************************
 dnl Canberra / Canberra-GTK Sound
 dnl ******************************
 AC_ARG_ENABLE([canberra],
diff --git a/shell/Makefile.am b/shell/Makefile.am
index ca722fc..3ebf5dc 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -62,6 +62,7 @@ libeshell_la_CPPFLAGS =						\
 	$(GNOME_PLATFORM_CFLAGS)				\
 	$(EGG_SMCLIENT_CFLAGS)					\
 	$(GTKHTML_CFLAGS)					\
+	$(DBUS_GLIB_CFLAGS)					\
 	$(CLUTTER_CFLAGS)
 
 libeshell_la_SOURCES =				\
@@ -100,6 +101,7 @@ libeshell_la_LIBADD =					\
 	$(EVOLUTION_DATA_SERVER_LIBS)			\
 	$(GNOME_PLATFORM_LIBS)				\
 	$(EGG_SMCLIENT_LIBS)				\
+	$(DBUS_GLIB_LIBS)				\
 	$(CLUTTER_LIBS)
 
 # Evolution executable
diff --git a/shell/main.c b/shell/main.c
index 8ba2a98..4aa6425 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -30,6 +30,8 @@
 #include <glib-unix.h>
 #endif
 
+#include <dbus/dbus-glib.h>
+
 #if HAVE_CLUTTER
 #include <clutter-gtk/clutter-gtk.h>
 #include <mx/mx.h>
@@ -497,6 +499,9 @@ main (gint argc,
 
 	g_type_init ();
 
+	/* this is to initialize threading for dbus-glib used by GConf */
+	dbus_g_thread_init ();
+
 	/* do not require Gtk+ for --force-shutdown */
 	if (argc == 2 && argv[1] && g_str_equal (argv[1], "--force-shutdown")) {
 		shell_force_shutdown ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]