[evolution-data-server] Call gtk_init_check() in factories with enabled maintainer mode



commit f3129ab77f9ae3ef6f51c91768503446f8356087
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 4 11:31:15 2011 +0200

    Call gtk_init_check() in factories with enabled maintainer mode
    
    That's to have loaded gtk-modules, like gnomesegvhandler
    from bug-buddy, if it's possible. Factories can still be
    run without gtk environment.

 addressbook/libedata-book/Makefile.am           |    6 ++++--
 addressbook/libedata-book/e-data-book-factory.c |    9 +++++++++
 calendar/libedata-cal/Makefile.am               |    6 ++++--
 calendar/libedata-cal/e-data-cal-factory.c      |    9 +++++++++
 configure.ac                                    |   13 ++++++++++++-
 5 files changed, 38 insertions(+), 5 deletions(-)
---
diff --git a/addressbook/libedata-book/Makefile.am b/addressbook/libedata-book/Makefile.am
index 7506b63..50a689a 100644
--- a/addressbook/libedata-book/Makefile.am
+++ b/addressbook/libedata-book/Makefile.am
@@ -87,7 +87,8 @@ e_addressbook_factory_CPPFLAGS = \
 	-I$(top_builddir) \
 	-I$(top_builddir)/addressbook \
 	$(EVOLUTION_ADDRESSBOOK_CFLAGS) \
-	$(GOA_CFLAGS)
+	$(GOA_CFLAGS) \
+	$(FACTORY_GTK_CFLAGS)
 
 e_addressbook_factory_SOURCES = \
 	e-data-book-factory.c \
@@ -99,7 +100,8 @@ e_addressbook_factory_LDADD = \
 	$(top_builddir)/libedataserver/libedataserver-1.2.la \
 	$(top_builddir)/libebackend/libebackend-1.2.la \
 	$(EVOLUTION_ADDRESSBOOK_LIBS) \
-	$(GOA_LIBS)
+	$(GOA_LIBS) \
+	$(FACTORY_GTK_LIBS)
 
 %-$(API_VERSION).pc: %.pc
 	 cp $< $@
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index e49a1e3c..d0a4546 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -26,6 +26,10 @@
 #include <unistd.h>
 #include <glib/gi18n.h>
 
+#ifdef ENABLE_MAINTAINER_MODE
+#include <gtk/gtk.h>
+#endif
+
 #ifdef G_OS_UNIX
 #if GLIB_CHECK_VERSION(2,29,5)
 #include <glib-unix.h>
@@ -801,6 +805,11 @@ main (gint argc, gchar **argv)
 	g_set_prgname (E_PRGNAME);
 	if (!g_thread_supported ()) g_thread_init (NULL);
 
+	#ifdef ENABLE_MAINTAINER_MODE
+	/* only to load gtk-modules, like bug-buddy's gnomesegvhandler, if possible */
+	gtk_init_check (&argc, &argv);
+	#endif
+
 	context = g_option_context_new (NULL);
 	g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
 	g_option_context_parse (context, &argc, &argv, &error);
diff --git a/calendar/libedata-cal/Makefile.am b/calendar/libedata-cal/Makefile.am
index 5bbd4e6..8ca641d 100644
--- a/calendar/libedata-cal/Makefile.am
+++ b/calendar/libedata-cal/Makefile.am
@@ -106,13 +106,15 @@ e_calendar_factory_CPPFLAGS = \
 	-I$(top_builddir)				\
 	-I$(top_builddir)/calendar			\
 	$(LIBICAL_CFLAGS)				\
-	$(EVOLUTION_CALENDAR_CFLAGS)
+	$(EVOLUTION_CALENDAR_CFLAGS)			\
+	$(FACTORY_GTK_CFLAGS)
 
 e_calendar_factory_LDADD =						\
 	$(top_builddir)/calendar/libecal/libecal-1.2.la			\
 	$(top_builddir)/calendar/libegdbus/libegdbus-cal.la		\
 	libedata-cal-1.2.la						\
 	$(top_builddir)/libedataserver/libedataserver-1.2.la 		\
-	$(top_builddir)/libebackend/libebackend-1.2.la
+	$(top_builddir)/libebackend/libebackend-1.2.la			\
+	$(FACTORY_GTK_LIBS)
 
 -include $(top_srcdir)/git.mk
diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index 660f010..32771e1 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -30,6 +30,10 @@
 #include <unistd.h>
 #include <glib/gi18n.h>
 
+#ifdef ENABLE_MAINTAINER_MODE
+#include <gtk/gtk.h>
+#endif
+
 #ifdef G_OS_UNIX
 #if GLIB_CHECK_VERSION(2,29,5)
 #include <glib-unix.h>
@@ -1023,6 +1027,11 @@ main (gint argc, gchar **argv)
 	g_set_prgname (E_PRGNAME);
 	if (!g_thread_supported ()) g_thread_init (NULL);
 
+	#ifdef ENABLE_MAINTAINER_MODE
+	/* only to load gtk-modules, like bug-buddy's gnomesegvhandler, if possible */
+	gtk_init_check (&argc, &argv);
+	#endif
+
 	context = g_option_context_new (NULL);
 	g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
 	g_option_context_parse (context, &argc, &argv, &error);
diff --git a/configure.ac b/configure.ac
index 0773f6f..bf3601a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,6 +211,10 @@ dnl Initialize maintainer mode
 dnl ******************************
 AM_MAINTAINER_MODE
 
+if test "x$enable_maintainer_mode" = "xyes" ; then
+	AC_DEFINE(ENABLE_MAINTAINER_MODE, 1, [Configured with enabled maintainer mode])
+fi
+
 AC_PROG_CC
 AC_PROG_CPP
 AC_C_INLINE
@@ -541,7 +545,7 @@ LIBS="$save_LIBS"
 
 AC_ARG_ENABLE([backtraces],
 	[AS_HELP_STRING([--enable-backtraces],
-	[enable backtraces for e_ptr_tracker (default=no)])],
+	[enable backtraces for e_pointer_tracker (default=no)])],
 	[enable_backtraces=$enableval], [enable_backtraces=no])
 
 if test "x$enable_backtraces" = xyes; then
@@ -1317,6 +1321,13 @@ EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, , )
 AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
 AC_SUBST(E_DATA_SERVER_UI_LIBS)
 
+if test "x$enable_maintainer_mode" = "xyes" ; then
+	FACTORY_GTK_CFLAGS=$E_DATA_SERVER_UI_CFLAGS
+	FACTORY_GTK_LIBS=$E_DATA_SERVER_UI_LIBS
+	AC_SUBST(FACTORY_GTK_CFLAGS)
+	AC_SUBST(FACTORY_GTK_LIBS)
+fi
+
 E_BACKEND_DEPS="gio-2.0 libxml-2.0 gconf-2.0"
 
 dnl ******************************



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