[gnome-control-center] shell: Move cheese_gtk_init() call earlier



commit a70172cfeacd1037e3b1d43431cd10b8084dbf6d
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Sat Jun 20 21:04:12 2015 +0200

    shell: Move cheese_gtk_init() call earlier
    
    Now that we handle local command line arguments, the 'command_line'
    vfunc can no longer get the initial argc/argv passed to the process.
    Now, cheese_gtk_init() is called unconditionally from main()
    where argc/argv are available.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751597

 shell/cc-application.c |   13 -------------
 shell/main.c           |    8 ++++++++
 2 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/shell/cc-application.c b/shell/cc-application.c
index 26221ce..bedf4c1 100644
--- a/shell/cc-application.c
+++ b/shell/cc-application.c
@@ -34,10 +34,6 @@
 #include <clutter-gtk/clutter-gtk.h>
 #endif /* HAVE_CHEESE || HAVE_WACOM */
 
-#ifdef HAVE_CHEESE
-#include <cheese-gtk.h>
-#endif /* HAVE_CHEESE */
-
 struct _CcApplicationPrivate
 {
   CcWindow *window;
@@ -131,21 +127,14 @@ cc_application_command_line (GApplication *application,
                              GApplicationCommandLine *command_line)
 {
   CcApplication *self = CC_APPLICATION (application);
-  int argc;
-  char **argv;
   GVariantDict *options;
   int retval = 0;
   char *search_str;
   GStrv start_panels = NULL;
   gboolean debug;
 
-  argv = g_application_command_line_get_arguments (command_line, &argc);
   options = g_application_command_line_get_options_dict (command_line);
 
-#ifdef HAVE_CHEESE
-  cheese_gtk_init (&argc, &argv);
-#endif /* HAVE_CHEESE */
-
   debug = g_variant_dict_contains (options, "verbose");
   cc_shell_log_set_debug (debug);
 
@@ -196,8 +185,6 @@ cc_application_command_line (GApplication *application,
   g_free (start_panels);
   start_panels = NULL;
 
-  g_strfreev (argv);
-
   return retval;
 }
 
diff --git a/shell/main.c b/shell/main.c
index 3bf139e..957dd1f 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -29,6 +29,10 @@
 #include <X11/Xlib.h>
 #endif
 
+#ifdef HAVE_CHEESE
+#include <cheese-gtk.h>
+#endif /* HAVE_CHEESE */
+
 #include "cc-application.h"
 
 int
@@ -45,6 +49,10 @@ main (int argc, char **argv)
   XInitThreads ();
 #endif
 
+#ifdef HAVE_CHEESE
+  cheese_gtk_init (&argc, &argv);
+#endif /* HAVE_CHEESE */
+
   application = cc_application_new ();
   status = g_application_run (G_APPLICATION (application), argc, argv);
 


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