gnome-games r8064 - trunk/glines



Author: thomashpa
Date: Fri Oct 17 16:51:40 2008
New Revision: 8064
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8064&view=rev

Log:
use egg_sm_client_is_resumed() to detect sm restart. Also correct callback signature. Thanks chpe.

Modified:
   trunk/glines/glines.c

Modified: trunk/glines/glines.c
==============================================================================
--- trunk/glines/glines.c	(original)
+++ trunk/glines/glines.c	Fri Oct 17 16:51:40 2008
@@ -1623,11 +1623,12 @@
 #ifdef WITH_SMCLIENT
 static int
 save_state_cb (EggSMClient *client,
+	    GKeyFile* keyfile,
 	    gpointer client_data)
 {
   gchar *buf;
   int argc = 0;
-  char *argv[2];
+  char *argv[1];
   int i;
 
   games_conf_set_integer (KEY_SAVED_GROUP, KEY_SAVED_SCORE, score);
@@ -1648,7 +1649,6 @@
   g_free (buf);
 
   argv[argc++] = g_get_prgname ();
-  argv[argc++] = " --resume";
 
   egg_sm_client_set_restart_command (client, argc, (const char **) argv);
 
@@ -1812,11 +1812,6 @@
   GError *error = NULL;
 #ifdef WITH_SMCLIENT
   EggSMClient *sm_client;
-  gboolean resume = FALSE;
-  const GOptionEntry options[] = {
-    { "resume", 'r', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &resume, NULL, NULL },
-    { NULL }
-  };
 #endif /* WITH_SMCLIENT */
 
 #if defined(HAVE_GNOME) || defined(HAVE_RSVG_GNOMEVFS)
@@ -1845,7 +1840,6 @@
   g_option_context_add_group (context, gtk_get_option_group (TRUE));
 #ifdef WITH_SMCLIENT
   g_option_context_add_group (context, egg_sm_client_get_option_group ());
-  g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
 #endif /* WITH_SMCLIENT */
 
   retval = g_option_context_parse (context, &argc, &argv, &error);
@@ -1874,7 +1868,7 @@
 		    G_CALLBACK (save_state_cb), NULL);
   g_signal_connect (sm_client, "quit",
                     G_CALLBACK (quit_cb), NULL);
-  if (resume)
+  if (egg_sm_client_is_resumed(sm_client))
     restart ();
   else
     reset_game ();



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