[gnome-games/wip/aplazas/781334-refactor-game-source: 22/35] mame: Provide MIME types and URI game factories



commit 60ab66d90084c56ba6fe748194168672b4a1b094
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu May 4 15:37:36 2017 +0200

    mame: 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/mame/src/mame-plugin.vala |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/plugins/mame/src/mame-plugin.vala b/plugins/mame/src/mame-plugin.vala
index 6e93279..2382730 100644
--- a/plugins/mame/src/mame-plugin.vala
+++ b/plugins/mame/src/mame-plugin.vala
@@ -1,17 +1,18 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 private class Games.MamePlugin : Object, Plugin {
-       private const string SEARCHED_MIME_TYPE = "application/zip";
+       private const string MIME_TYPE = "application/zip";
 
-       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 MameGameUriAdapter ();
                var factory = new GenericUriGameFactory (game_uri_adapter);
-               var query = new MimeTypeTrackerQuery (SEARCHED_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 };
        }
 }
 


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