[libgames-support] Simplify load_scores_from_file a bit
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgames-support] Simplify load_scores_from_file a bit
- Date: Sun, 14 Feb 2016 22:24:23 +0000 (UTC)
commit 35dc29347646231778d8c3bb6f85d5686b271879
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Feb 14 16:20:52 2016 -0600
Simplify load_scores_from_file a bit
games/scores/context.vala | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/games/scores/context.vala b/games/scores/context.vala
index d4815f2..f06b8f2 100644
--- a/games/scores/context.vala
+++ b/games/scores/context.vala
@@ -279,17 +279,13 @@ public class Context : Object
throw new FileError.FAILED ("Failed to parse %s for scores.", filename);
}
- if (tokens.length < 3)
- {
- user = Environment.get_real_name ();
- debug ("Treating user as %s for old score in %s.", user, filename);
- }
-
var score_value = long.parse (tokens[0]);
var time = int64.parse (tokens[1]);
- if (user == null)
+ if (tokens.length == 3)
user = tokens[2];
+ else
+ debug ("Assuming current username for old score in %s.", filename);
scores_of_single_category.add (new Score (score_value, time, user));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]