[gnome-games] nintendo-64: Provide MIME types and URI game factories



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

    nintendo-64: 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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781334

 plugins/nintendo-64/configure.ac                |    1 -
 plugins/nintendo-64/src/nintendo-64-plugin.vala |   13 +++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/plugins/nintendo-64/configure.ac b/plugins/nintendo-64/configure.ac
index cd3ea83..ade4911 100644
--- a/plugins/nintendo-64/configure.ac
+++ b/plugins/nintendo-64/configure.ac
@@ -3,7 +3,6 @@ PKG_CHECK_MODULES(NINTENDO_64_PLUGIN, [
        glib-2.0 >= $GLIB_MIN_VERSION
        gtk+-3.0
        retro-gtk-0.10
-       tracker-sparql-1.0
 ], [enable_nintendo_64_plugin=yes], [enable_nintendo_64_plugin=no])
 
 AM_CONDITIONAL(ENABLE_NINTENDO_64_PLUGIN, test x$enable_nintendo_64_plugin != xno)
diff --git a/plugins/nintendo-64/src/nintendo-64-plugin.vala b/plugins/nintendo-64/src/nintendo-64-plugin.vala
index 68add44..4745639 100644
--- a/plugins/nintendo-64/src/nintendo-64-plugin.vala
+++ b/plugins/nintendo-64/src/nintendo-64-plugin.vala
@@ -5,15 +5,16 @@ private class Games.Nintendo64Plugin : Object, Plugin {
        private const string MIME_TYPE = "application/x-n64-rom";
        private const string PLATFORM = "Nintendo64";
 
-       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]