[libgames-support] scores: Context: add warning about sync I/O
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgames-support] scores: Context: add warning about sync I/O
- Date: Sun, 22 Feb 2015 23:31:54 +0000 (UTC)
commit cae724081314a911443685b10c0c9c880fc054f8
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Feb 22 13:41:14 2015 -0600
scores: Context: add warning about sync I/O
scores/context.vala | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/scores/context.vala b/scores/context.vala
index 27f8220..6e0be59 100644
--- a/scores/context.vala
+++ b/scores/context.vala
@@ -201,9 +201,14 @@ public class Context : Object
private void load_scores_from_files () throws Error
{
- /* All the I/O in this function is synchronous because it is called when
- the Context object is created. That should be when the application is
- loading its UI. */
+ if (game_window != null && game_window.visible)
+ {
+ warning ("The application window associated with the GamesScoresContext " +
+ "was set visible before the Context was constructed. The Context " +
+ "performs synchronous I/O to load scores when it is constructed, " +
+ "so you should create the Context before showing your main window.");
+ }
+
var directory = File.new_for_path (user_score_dir);
if (!directory.query_exists ())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]