[gnome-nibbles] Minor improvement to startup code
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles] Minor improvement to startup code
- Date: Thu, 13 Nov 2014 14:58:07 +0000 (UTC)
commit 3f6f9acc3cb60eab364380bf8ed6a7b662bcfac8
Author: Sahil Sareen <sahil sareen hotmail com>
Date: Tue Nov 11 23:27:50 2014 +0530
Minor improvement to startup code
Don't connect to the default windowing system when you parse the command line options
instead you defer the connection to when you initialize gtk and clutter via gtk_clutter_init which does
the things in the correct order
https://bugzilla.gnome.org/show_bug.cgi?id=740006
src/main.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index d03da98..1232c9e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -685,9 +685,14 @@ main (int argc, char **argv)
GError *error = NULL;
GOptionContext *context;
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
context = g_option_context_new ("");
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
- g_option_context_add_group (context, gtk_get_option_group (TRUE));
+ g_option_context_add_group (context, gtk_get_option_group (FALSE));
if (!g_option_context_parse (context, &argc, &argv, &error))
{
@@ -696,15 +701,6 @@ main (int argc, char **argv)
}
//Done handling Command Line options
- setlocale (LC_ALL, "");
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- games_scores_startup ();
-
- g_set_application_name (_("Nibbles"));
-
if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) {
GtkWidget *dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL,
@@ -717,6 +713,10 @@ main (int argc, char **argv)
exit (1);
}
+ games_scores_startup ();
+
+ g_set_application_name (_("Nibbles"));
+
settings = g_settings_new ("org.gnome.nibbles");
for (i = 0; i < NUMWORMS; i++)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]