[gnome-games/wip/aplazas/781334-refactor-game-source: 17/35] dreamcast: 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: 17/35] dreamcast: Provide MIME types and URI game factories
- Date: Thu, 4 May 2017 16:14:11 +0000 (UTC)
commit 67aef247e29922e94d345fbc1b557f1e043bed28
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu May 4 15:36:38 2017 +0200
dreamcast: 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/dreamcast/src/dreamcast-plugin.vala | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/plugins/dreamcast/src/dreamcast-plugin.vala b/plugins/dreamcast/src/dreamcast-plugin.vala
index 972f891..d825e38 100644
--- a/plugins/dreamcast/src/dreamcast-plugin.vala
+++ b/plugins/dreamcast/src/dreamcast-plugin.vala
@@ -4,15 +4,16 @@ private class Games.DreamcastPlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-dc-rom";
private const string PLATFORM = "Dreamcast";
- 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]