[libgames-support] scores: Rearrange
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgames-support] scores: Rearrange
- Date: Sun, 14 Feb 2016 22:00:05 +0000 (UTC)
commit 08841664139e3faa396c3f34f4c75975ed0d8ee7
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Feb 14 12:50:35 2016 -0600
scores: Rearrange
games/scores/context.vala | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/games/scores/context.vala b/games/scores/context.vala
index 8fffd6f..e86ea43 100644
--- a/games/scores/context.vala
+++ b/games/scores/context.vala
@@ -177,6 +177,20 @@ public class Context : Object
return result;
}
+ private async void save_score_to_file (Score score, Category category, Cancellable? cancellable) throws
Error
+ {
+ if (DirUtils.create_with_parents (user_score_dir, 0766) == -1)
+ {
+ throw new FileError.FAILED ("Failed to create %s: %s", user_score_dir, strerror (errno));
+ }
+
+ var file = File.new_for_path (Path.build_filename (user_score_dir, category.key));
+ var stream = file.append_to (FileCreateFlags.NONE);
+ var line = @"$(score.score) $(score.time) $(score.user)\n";
+
+ yield stream.write_all_async (line.data, Priority.DEFAULT, cancellable, null);
+ }
+
/* Return true if a dialog was launched on attaining high score */
public async bool add_score (long score_value, Category category, Cancellable? cancellable = null)
throws Error
{
@@ -205,20 +219,6 @@ public class Context : Object
return high_score_added;
}
- private async void save_score_to_file (Score score, Category category, Cancellable? cancellable) throws
Error
- {
- if (DirUtils.create_with_parents (user_score_dir, 0766) == -1)
- {
- throw new FileError.FAILED ("Failed to create %s: %s", user_score_dir, strerror (errno));
- }
-
- var file = File.new_for_path (Path.build_filename (user_score_dir, category.key));
- var stream = file.append_to (FileCreateFlags.NONE);
- var line = @"$(score.score) $(score.time) $(score.user)\n";
-
- yield stream.write_all_async (line.data, Priority.DEFAULT, cancellable, null);
- }
-
private void load_scores_from_file (FileInfo file_info) throws Error
{
var category_key = file_info.get_name ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]