[gnome-todo] application: Initialize logging earlier



commit 5e92f0fd88d3c38352c814bfc0d9cd9a40cc5941
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Feb 1 13:22:51 2018 -0200

    application: Initialize logging earlier

 src/gtd-application.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/gtd-application.c b/src/gtd-application.c
index 8bf0231..764bfd5 100644
--- a/src/gtd-application.c
+++ b/src/gtd-application.c
@@ -302,9 +302,6 @@ gtd_application_command_line (GApplication            *app,
 
   options = g_application_command_line_get_options_dict (command_line);
 
-  //if (g_variant_dict_contains (options, "debug"))
-    gtd_log_init ();
-
   if (g_variant_dict_contains (options, "quit"))
     {
       g_application_quit (app);
@@ -328,6 +325,16 @@ gtd_application_local_command_line (GApplication   *application,
                                                                                  exit_status);
 }
 
+static gint
+gtd_application_handle_local_options (GApplication *application,
+                                      GVariantDict *options)
+{
+  if (g_variant_dict_contains (options, "debug"))
+    gtd_log_init ();
+
+  return -1;
+}
+
 static void
 gtd_application_class_init (GtdApplicationClass *klass)
 {
@@ -340,6 +347,7 @@ gtd_application_class_init (GtdApplicationClass *klass)
   application_class->startup = gtd_application_startup;
   application_class->command_line = gtd_application_command_line;
   application_class->local_command_line = gtd_application_local_command_line;
+  application_class->handle_local_options = gtd_application_handle_local_options;
 }
 
 static void


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