aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-utils.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-12-12 23:49:15 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-12-12 23:49:15 +0800
commit37d437ae1c69c8c70f5a289ec59363fe21836255 (patch)
treeb9743323a1a94c6ecf84cbe87892f6bbd38a6b19 /libempathy/empathy-utils.c
parent7e20ee7f05f61981933be27e4332698a19cc04e6 (diff)
downloadgsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.gz
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.bz2
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.lz
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.xz
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.zst
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.zip
Add empathy_init(), empathy_gtk_init() and empathy_gtk_init_with_args(). They have to be called by any process using libempathy.
svn path=/trunk/; revision=1966
Diffstat (limited to 'libempathy/empathy-utils.c')
-rw-r--r--libempathy/empathy-utils.c27
1 files changed, 27 insertions, 0 deletions
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,