[gnome-dictionary] gdict: Add library init function
- From: Juan R. Garcia Blanco <juanrgar src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-dictionary] gdict: Add library init function
 
- Date: Sat, 25 Jul 2015 21:36:54 +0000 (UTC)
 
commit c26a07a12782c9a0849f3eadb1bb49b95a5bae04
Author: Juan R. GarcĂa Blanco <juanrgar gmail com>
Date:   Sat Jul 25 14:58:51 2015 +0200
    gdict: Add library init function
    
    Add gdict_init() function to initialize the library.
    Now it only enables debug options.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=745786
 libgdict/gdict-utils.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/libgdict/gdict-utils.c b/libgdict/gdict-utils.c
index b6041f6..cc33772 100644
--- a/libgdict/gdict-utils.c
+++ b/libgdict/gdict-utils.c
@@ -88,7 +88,7 @@ gdict_arg_no_debug_cb (const char *key,
                            G_N_ELEMENTS (gdict_debug_keys));
   return TRUE;
 }
-#endif /* CLUTTER_ENABLE_DEBUG */
+#endif /* GDICT_ENABLE_DEBUG */
 
 static GOptionEntry gdict_args[] = {
 #ifdef GDICT_ENABLE_DEBUG
@@ -133,7 +133,8 @@ post_parse_hook (GOptionContext  *context,
                  gpointer         data,
                  GError         **error)
 {
-  gdict_is_initialized = TRUE;
+  if (gdict_is_initialized)
+    return TRUE;
 
   return TRUE;
 }
@@ -330,3 +331,24 @@ _gdict_show_gerror_dialog (GtkWidget   *widget,
       
   g_error_free (error);
 }
+
+/**
+ * gdict_init:
+ * @argc: FIXME
+ * @argv: FIXME
+ *
+ * FIXME
+ *
+ * Since: 0.12
+ */
+void
+gdict_init (gint    *argc,
+            gchar ***argv)
+{
+  if (gdict_is_initialized)
+    return;
+
+  gdict_debug_init (argc, argv);
+
+  gdict_is_initialized = TRUE;
+}
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]