Commit 7b3ab98d authored by Christian Persch's avatar Christian Persch Committed by Christian Persch

Fix timer suspend on window iconification; and fix the corrupted

2007-09-07  Christian Persch  <chpe@gnome.org>

	* conf.c: (load_statistics):
	* game.c: (aisleriot_game_set_paused): Fix timer suspend on window
	iconification; and fix the corrupted statistics on load.

svn path=/trunk/; revision=6763
parent 188a7425
2007-09-07 Christian Persch <chpe@gnome.org>
* conf.c: (load_statistics):
* game.c: (aisleriot_game_set_paused): Fix timer suspend on window
iconification; and fix the corrupted statistics on load.
2007-08-30 Christian Persch <chpe@gnome.org>
* game.c: (update_game_dealable): Remove stray debug spew.
......
......@@ -72,6 +72,7 @@ load_statistics (void)
{
GSList *raw_list;
AisleriotStatistic *new_stats;
guint64 value;
raw_list = gconf_client_get_list (gconf_client, statistics_key,
GCONF_VALUE_STRING, NULL);
......@@ -106,13 +107,25 @@ load_statistics (void)
if (!raw_list)
break;
new_stats->best = g_ascii_strtoull (raw_list->data, NULL, 10);
value = g_ascii_strtoull (raw_list->data, NULL, 10);
/* Sanitise value to fix statistics from bug #474615 */
if (value > 0 && value <= 6000) {
new_stats->best = value;
} else {
new_stats->best = 0;
}
g_free (raw_list->data);
raw_list = g_slist_delete_link (raw_list, raw_list);
if (!raw_list)
break;
new_stats->worst = g_ascii_strtoull (raw_list->data, NULL, 10);
value = g_ascii_strtoull (raw_list->data, NULL, 10);
/* Sanitise value to fix statistics from bug #474615 */
if (value > 0 && value <= 6000) {
new_stats->worst = value;
} else {
new_stats->worst = 0;
}
g_free (raw_list->data);
raw_list = g_slist_delete_link (raw_list, raw_list);
}
......
......@@ -15,8 +15,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/
#include "config.h"
......@@ -1436,7 +1434,7 @@ aisleriot_game_set_paused (AisleriotGame *game,
if (paused == game->paused)
return;
paused = game->paused;
game->paused = paused;
/* (Re)store the start time */
game->start_time = time (NULL) - game->start_time;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment