[gnome-games/wip/aplazas/781334-refactor-game-source: 11/12] wii-ware: Provide MIME types and URI game factories



commit 8b6e72e51bc4429607961dce1ceca51a432f7681
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu May 4 15:40:33 2017 +0200

    wii-ware: 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/wii-ware/src/wii-ware-plugin.vala |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/plugins/wii-ware/src/wii-ware-plugin.vala b/plugins/wii-ware/src/wii-ware-plugin.vala
index cae99b4..3a51507 100644
--- a/plugins/wii-ware/src/wii-ware-plugin.vala
+++ b/plugins/wii-ware/src/wii-ware-plugin.vala
@@ -5,15 +5,16 @@ private class Games.WiiWarePlugin : Object, Plugin {
        private const string MIME_TYPE = "application/x-wii-wad";
        private const string PLATFORM = "Wii";
 
-       public GameSource? get_game_source () throws Error {
+       public string[] get_mime_types () {
+               return { MIME_TYPE };
+       }
+
+       public UriGameFactory[] get_uri_game_factories () {
                var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
                var factory = new GenericUriGameFactory (game_uri_adapter);
-               var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
-               var connection = Tracker.Sparql.Connection.@get ();
-               var source = new TrackerGameSource (connection);
-               source.add_query (query);
+               factory.add_mime_type (MIME_TYPE);
 
-               return source;
+               return { factory };
        }
 
        private static Game game_for_uri (string uri) throws Error {


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