[gnome-games/wip/aplazas/781334-refactor-game-source: 30/37] playstation: Provide MIME types and URI game factories



commit 28214d8f078794529388caa965b1c00dc3ad5c89
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu May 4 15:39:48 2017 +0200

    playstation: Provide MIME types and URI game factories
    
    Also stop providing a GameSource.
    
    This helps splitting the conerns of looking for game resources and
    building games from them.

 plugins/playstation/src/playstation-plugin.vala |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/plugins/playstation/src/playstation-plugin.vala b/plugins/playstation/src/playstation-plugin.vala
index e99a85a..87194a5 100644
--- a/plugins/playstation/src/playstation-plugin.vala
+++ b/plugins/playstation/src/playstation-plugin.vala
@@ -1,16 +1,16 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 private class Games.PlayStation : Object, Plugin {
-       private const string SEARCHED_MIME_TYPE = "application/x-cue";
+       private const string MIME_TYPE = "application/x-cue";
 
-       public GameSource? get_game_source () throws Error {
+       public string[] get_mime_types () {
+               return { MIME_TYPE };
+       }
+
+       public UriGameFactory[] get_uri_game_factories () {
                var factory = new PlayStationGameFactory ();
-               var query = new MimeTypeTrackerQuery (SEARCHED_MIME_TYPE, factory);
-               var connection = Tracker.Sparql.Connection.@get ();
-               var source = new TrackerGameSource (connection);
-               source.add_query (query);
 
-               return source;
+               return { factory };
        }
 }
 


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