[gnome-video-arcade] Tolerate more errors in Catver.ini and nplayers.ini.



commit 6b27870a98b00fab50c0d7d9d5797ca97cc44350
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Mar 10 20:15:17 2010 -0500

    Tolerate more errors in Catver.ini and nplayers.ini.
    
    Particularly, if the files are missing or unreadable for some reason we
    get G_KEY_FILE_ERROR_GROUP_NOT_FOUND errors when querying the key files.
    Silence this error so it doesn't derail the whole database construction
    process.

 src/gva-db.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/gva-db.c b/src/gva-db.c
index 8fc8871..d22617f 100644
--- a/src/gva-db.c
+++ b/src/gva-db.c
@@ -987,6 +987,11 @@ db_parser_start_element_game (ParserData *data,
         if (g_error_matches (local_error, G_KEY_FILE_ERROR, error_code))
                 g_clear_error (&local_error);
 
+        /* Silence "group not found" errors. */
+        error_code = G_KEY_FILE_ERROR_GROUP_NOT_FOUND;
+        if (g_error_matches (local_error, G_KEY_FILE_ERROR, error_code))
+                g_clear_error (&local_error);
+
         if (category != NULL)
                 db_parser_bind_text (stmt, "@category", category);
         else if (local_error != NULL)
@@ -1048,6 +1053,11 @@ db_parser_start_element_input (ParserData *data,
         if (g_error_matches (local_error, G_KEY_FILE_ERROR, error_code))
                 g_clear_error (&local_error);
 
+        /* Silence "group not found" errors. */
+        error_code = G_KEY_FILE_ERROR_GROUP_NOT_FOUND;
+        if (g_error_matches (local_error, G_KEY_FILE_ERROR, error_code))
+                g_clear_error (&local_error);
+
         db_parser_bind_int (stmt, "@input_players_alt", max_alternating);
         db_parser_bind_int (stmt, "@input_players_sim", max_simultaneous);
 



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