[gnome-games/wip/aplazas/781334-refactor-game-source: 21/37] love: Provide MIME types and URI game factories
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/781334-refactor-game-source: 21/37] love: Provide MIME types and URI game factories
- Date: Sat, 6 May 2017 21:42:41 +0000 (UTC)
commit 7ab27ed82b54d34c79912d97bd0907329b6e126b
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu May 4 15:37:29 2017 +0200
love: 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/love/configure.ac | 1 -
plugins/love/src/love-plugin.vala | 13 +++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/plugins/love/configure.ac b/plugins/love/configure.ac
index e38f274..8b042b4 100644
--- a/plugins/love/configure.ac
+++ b/plugins/love/configure.ac
@@ -4,7 +4,6 @@ PKG_CHECK_MODULES(LOVE_PLUGIN, [
gtk+-3.0
libarchive
retro-gtk-0.10
- tracker-sparql-1.0
], [enable_love_plugin=yes], [enable_love_plugin=no])
AM_CONDITIONAL(ENABLE_LOVE_PLUGIN, test x$enable_love_plugin != xno)
diff --git a/plugins/love/src/love-plugin.vala b/plugins/love/src/love-plugin.vala
index a6c983f..6ec742a 100644
--- a/plugins/love/src/love-plugin.vala
+++ b/plugins/love/src/love-plugin.vala
@@ -3,15 +3,16 @@
private class Games.LovePlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-love-game";
- 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]