[gnome-session/wip/cleanups: 1/15] Don't initialize gtk in gnome-session-quit



commit fded4d4882c364b09d4b242e305c4a386fdd5694
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Nov 11 18:09:26 2012 -0500

    Don't initialize gtk in gnome-session-quit
    
    Its not needed at all.

 tools/gnome-session-quit.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/tools/gnome-session-quit.c b/tools/gnome-session-quit.c
index 5b94c74..b211584 100644
--- a/tools/gnome-session-quit.c
+++ b/tools/gnome-session-quit.c
@@ -27,8 +27,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <glib.h>
 #include <glib/gi18n.h>
-#include <gtk/gtk.h>
 
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-lowlevel.h>
@@ -175,6 +175,7 @@ main (int argc, char *argv[])
 {
         GError *error;
         int     conflicting_options;
+        GOptionContext *ctx;
 
         /* Initialize the i18n stuff */
         bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
@@ -182,11 +183,14 @@ main (int argc, char *argv[])
         textdomain (GETTEXT_PACKAGE);
 
         error = NULL;
-        if (! gtk_init_with_args (&argc, &argv, NULL, options, NULL, &error)) {
+        ctx = g_option_context_new ("");
+        g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
+        if (! g_option_context_parse (ctx, &argc, &argv, &error)) {
                 g_warning ("Unable to start: %s", error->message);
                 g_error_free (error);
                 exit (1);
         }
+        g_option_context_free (ctx);
 
         conflicting_options = 0;
         if (opt_logout)



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