[gnome-games] gameinfo: Add GameinfoDoc.get_game_controllers_for_disc_id()



commit d9a455d5dbadaa03aec9c2a9c2e2624d18af5284
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Aug 30 14:43:30 2016 +0200

    gameinfo: Add GameinfoDoc.get_game_controllers_for_disc_id()
    
    This will be used in the next commit to get controller informations from
    a Gameinfo doc.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770192

 src/gameinfo/gameinfo-doc.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gameinfo/gameinfo-doc.vala b/src/gameinfo/gameinfo-doc.vala
index e2cc625..e937039 100644
--- a/src/gameinfo/gameinfo-doc.vala
+++ b/src/gameinfo/gameinfo-doc.vala
@@ -17,6 +17,12 @@ public class Games.GameinfoDoc : Object {
                return title;
        }
 
+       public string[] get_game_controllers_for_disc_id (string disc_id) throws Error {
+               var expr = "/gameinfo/games/game[discs/disc[@id = \"" + disc_id + 
"\"]]/controllers/controller/@type";
+
+               return xml_doc.get_contents (expr);
+       }
+
        public string? get_disc_title_for_disc_id (string disc_id) throws Error {
                var expr = "/gameinfo/games/game/discs/disc[@id = \"" + disc_id + "\"]/title";
 


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