diff options
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/Makefile.am | 1 | ||||
-rw-r--r-- | libempathy/empathy-utils.c | 27 | ||||
-rw-r--r-- | libempathy/empathy-utils.h | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am index a25c1e799..fd6424b57 100644 --- a/libempathy/Makefile.am +++ b/libempathy/Makefile.am @@ -3,6 +3,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -DDATADIR=\""$(datadir)"\" \ + -DLOCALEDIR=\""$(datadir)/locale"\" \ $(LIBEMPATHY_CFLAGS) \ $(WARN_CFLAGS) diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index 671595e68..dc06081f3 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -43,6 +43,33 @@ #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include "empathy-debug.h" +void +empathy_init (void) +{ + static gboolean initialized = FALSE; + + if (initialized) + return; + + /* Setup glib. Threads are required for async GIO. */ + g_thread_init (NULL); + g_type_init (); + + /* Setup gettext */ + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + /* Setup debug output for empathy and telepathy-glib */ + if (g_getenv ("EMPATHY_TIMING") != NULL) { + g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); + } + empathy_debug_set_flags (g_getenv ("EMPATHY_DEBUG")); + tp_debug_divert_messages (g_getenv ("EMPATHY_LOGFILE")); + + initialized = TRUE; +} + gchar * empathy_substring (const gchar *str, gint start, diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 51ddd231f..9147b6991 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -42,6 +42,7 @@ G_BEGIN_DECLS +void empathy_init (void); /* Strings */ gchar * empathy_substring (const gchar *str, gint start, |