[gnome-games/wip/aplazas/781334-refactor-game-source: 6/8] Replace TrackerGameSource by GenericUriGameSource
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/781334-refactor-game-source: 6/8] Replace TrackerGameSource by GenericUriGameSource
- Date: Thu, 4 May 2017 03:51:28 +0000 (UTC)
commit 1769f2494d9856d59184bf91de9c8f6653dc3b0c
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed May 3 21:17:24 2017 +0200
Replace TrackerGameSource by GenericUriGameSource
Replace usage of MimeTypeTrackerQuery and TrackerGameSource by
MimeTypeUriQuery and GenericUriGameSource to better split game resources
discovery and game object creation.
plugins/amiga/src/amiga-plugin.vala | 11 ++++++---
plugins/atari-2600/src/atari-2600-plugin.vala | 11 ++++++---
plugins/atari-7800/src/atari-7800-plugin.vala | 11 ++++++---
plugins/doom/src/doom-plugin.vala | 11 ++++++---
plugins/dreamcast/src/dreamcast-plugin.vala | 11 ++++++---
.../src/game-boy-advance-plugin.vala | 11 ++++++---
plugins/game-boy/src/game-boy-plugin.vala | 16 +++++++++-----
plugins/game-cube/src/game-cube-plugin.vala | 11 ++++++---
plugins/love/src/love-plugin.vala | 11 ++++++---
plugins/mame/src/mame-plugin.vala | 13 +++++++----
.../master-system/src/master-system-plugin.vala | 21 ++++++++++++-------
plugins/mega-drive/src/mega-drive-plugin.vala | 21 ++++++++++++-------
.../neo-geo-pocket/src/neo-geo-pocket-plugin.vala | 11 ++++++---
plugins/nes/src/nes-plugin.vala | 16 +++++++++-----
plugins/nintendo-64/src/nintendo-64-plugin.vala | 11 ++++++---
plugins/nintendo-ds/src/nintendo-ds-plugin.vala | 11 ++++++---
plugins/pc-engine/src/pc-engine-plugin.vala | 18 ++++++++++------
plugins/playstation/src/playstation-plugin.vala | 13 +++++++----
plugins/sega-saturn/src/sega-saturn-plugin.vala | 11 ++++++---
plugins/snes/src/snes-plugin.vala | 11 ++++++---
plugins/wii-ware/src/wii-ware-plugin.vala | 11 ++++++---
plugins/wii/src/wii-plugin.vala | 11 ++++++---
22 files changed, 178 insertions(+), 105 deletions(-)
---
diff --git a/plugins/amiga/src/amiga-plugin.vala b/plugins/amiga/src/amiga-plugin.vala
index 2b59a9b..9db4802 100644
--- a/plugins/amiga/src/amiga-plugin.vala
+++ b/plugins/amiga/src/amiga-plugin.vala
@@ -8,12 +8,15 @@ private class Games.AmigaPlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/atari-2600/src/atari-2600-plugin.vala b/plugins/atari-2600/src/atari-2600-plugin.vala
index a9f5cca..a9491e8 100644
--- a/plugins/atari-2600/src/atari-2600-plugin.vala
+++ b/plugins/atari-2600/src/atari-2600-plugin.vala
@@ -8,12 +8,15 @@ private class Games.Atari2600 : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/atari-7800/src/atari-7800-plugin.vala b/plugins/atari-7800/src/atari-7800-plugin.vala
index 900fed3..ca08f79 100644
--- a/plugins/atari-7800/src/atari-7800-plugin.vala
+++ b/plugins/atari-7800/src/atari-7800-plugin.vala
@@ -8,12 +8,15 @@ private class Games.Atari7800 : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/doom/src/doom-plugin.vala b/plugins/doom/src/doom-plugin.vala
index 268c92f..6ab6ee2 100644
--- a/plugins/doom/src/doom-plugin.vala
+++ b/plugins/doom/src/doom-plugin.vala
@@ -8,12 +8,15 @@ private class Games.DoomPlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/dreamcast/src/dreamcast-plugin.vala b/plugins/dreamcast/src/dreamcast-plugin.vala
index 5601097..0bcc22c 100644
--- a/plugins/dreamcast/src/dreamcast-plugin.vala
+++ b/plugins/dreamcast/src/dreamcast-plugin.vala
@@ -7,12 +7,15 @@ private class Games.DreamcastPlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/game-boy-advance/src/game-boy-advance-plugin.vala
b/plugins/game-boy-advance/src/game-boy-advance-plugin.vala
index 98f2f5b..5c89525 100644
--- a/plugins/game-boy-advance/src/game-boy-advance-plugin.vala
+++ b/plugins/game-boy-advance/src/game-boy-advance-plugin.vala
@@ -8,12 +8,15 @@ private class Games.GameBoyAdvancePlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/game-boy/src/game-boy-plugin.vala b/plugins/game-boy/src/game-boy-plugin.vala
index fcdb217..98150f8 100644
--- a/plugins/game-boy/src/game-boy-plugin.vala
+++ b/plugins/game-boy/src/game-boy-plugin.vala
@@ -14,14 +14,18 @@ private class Games.GameBoyPlugin : Object, Plugin {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var game_boy_factory = new GenericUriGameFactory (game_uri_adapter);
var game_boy_color_factory = new GenericUriGameFactory (game_uri_adapter);
- var game_boy_query = new MimeTypeTrackerQuery (GAME_BOY_MIME_TYPE, game_boy_factory);
- var game_boy_color_query = new MimeTypeTrackerQuery (GAME_BOY_COLOR_MIME_TYPE,
game_boy_color_factory);
+ var game_boy_query = new MimeTypeTrackerUriQuery (GAME_BOY_MIME_TYPE);
+ var game_boy_color_query = new MimeTypeTrackerUriQuery (GAME_BOY_COLOR_MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (game_boy_query);
- source.add_query (game_boy_color_query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (game_boy_query);
+ uri_source.add_query (game_boy_color_query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (game_boy_factory);
+ game_source.add_factory (game_boy_color_factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/game-cube/src/game-cube-plugin.vala b/plugins/game-cube/src/game-cube-plugin.vala
index bdbe8a5..f5fd48c 100644
--- a/plugins/game-cube/src/game-cube-plugin.vala
+++ b/plugins/game-cube/src/game-cube-plugin.vala
@@ -7,12 +7,15 @@ private class Games.GameCubePlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/love/src/love-plugin.vala b/plugins/love/src/love-plugin.vala
index c412f41..529c9ba 100644
--- a/plugins/love/src/love-plugin.vala
+++ b/plugins/love/src/love-plugin.vala
@@ -6,12 +6,15 @@ private class Games.LovePlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/mame/src/mame-plugin.vala b/plugins/mame/src/mame-plugin.vala
index 578c8dd..713b318 100644
--- a/plugins/mame/src/mame-plugin.vala
+++ b/plugins/mame/src/mame-plugin.vala
@@ -1,17 +1,20 @@
// 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 {
var game_uri_adapter = new MameGameUriAdapter ();
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (SEARCHED_MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
}
diff --git a/plugins/master-system/src/master-system-plugin.vala
b/plugins/master-system/src/master-system-plugin.vala
index 6490362..0e29a90 100644
--- a/plugins/master-system/src/master-system-plugin.vala
+++ b/plugins/master-system/src/master-system-plugin.vala
@@ -21,16 +21,21 @@ private class Games.MasterSystemPlugin : Object, Plugin {
var master_system_factory = new GenericUriGameFactory (game_uri_adapter);
var game_gear_factory = new GenericUriGameFactory (game_uri_adapter);
var sg_1000_factory = new GenericUriGameFactory (sg_1000_game_uri_adapter);
- var master_system_query = new MimeTypeTrackerQuery (MASTER_SYSTEM_MIME_TYPE,
master_system_factory);
- var game_gear_query = new MimeTypeTrackerQuery (GAME_GEAR_MIME_TYPE, game_gear_factory);
- var sg_1000_query = new MimeTypeTrackerQuery (SG_1000_MIME_TYPE, sg_1000_factory);
+ var master_system_query = new MimeTypeTrackerUriQuery (MASTER_SYSTEM_MIME_TYPE);
+ var game_gear_query = new MimeTypeTrackerUriQuery (GAME_GEAR_MIME_TYPE);
+ var sg_1000_query = new MimeTypeTrackerUriQuery (SG_1000_MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (master_system_query);
- source.add_query (game_gear_query);
- source.add_query (sg_1000_query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (master_system_query);
+ uri_source.add_query (game_gear_query);
+ uri_source.add_query (sg_1000_query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (master_system_factory);
+ game_source.add_factory (game_gear_factory);
+ game_source.add_factory (sg_1000_factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/mega-drive/src/mega-drive-plugin.vala b/plugins/mega-drive/src/mega-drive-plugin.vala
index 5592423..fd0f6a9 100644
--- a/plugins/mega-drive/src/mega-drive-plugin.vala
+++ b/plugins/mega-drive/src/mega-drive-plugin.vala
@@ -27,16 +27,21 @@ private class Games.MegaDrivePlugin : Object, Plugin {
var mega_drive_factory = new GenericUriGameFactory (game_uri_adapter);
var 32x_factory = new GenericUriGameFactory (game_uri_adapter);
var mega_cd_factory = new GenericUriGameFactory (cd_game_uri_adapter);
- var mega_drive_query = new MimeTypeTrackerQuery (MEGA_DRIVE_MIME_TYPE, mega_drive_factory);
- var 32x_query = new MimeTypeTrackerQuery (32X_MIME_TYPE, 32x_factory);
- var mega_cd_query = new MimeTypeTrackerQuery (CUE_MIME_TYPE, mega_cd_factory);
+ var mega_drive_query = new MimeTypeTrackerUriQuery (MEGA_DRIVE_MIME_TYPE);
+ var 32x_query = new MimeTypeTrackerUriQuery (32X_MIME_TYPE);
+ var mega_cd_query = new MimeTypeTrackerUriQuery (CUE_MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (mega_drive_query);
- source.add_query (32x_query);
- source.add_query (mega_cd_query);
-
- return source;
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (mega_drive_query);
+ uri_source.add_query (32x_query);
+ uri_source.add_query (mega_cd_query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (mega_drive_factory);
+ game_source.add_factory (32x_factory);
+ game_source.add_factory (mega_cd_factory);
+
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/neo-geo-pocket/src/neo-geo-pocket-plugin.vala
b/plugins/neo-geo-pocket/src/neo-geo-pocket-plugin.vala
index 3d90052..ca61b8f 100644
--- a/plugins/neo-geo-pocket/src/neo-geo-pocket-plugin.vala
+++ b/plugins/neo-geo-pocket/src/neo-geo-pocket-plugin.vala
@@ -8,12 +8,15 @@ private class Games.NeoGeoPocketPlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/nes/src/nes-plugin.vala b/plugins/nes/src/nes-plugin.vala
index 8fe52c7..21e69cb 100644
--- a/plugins/nes/src/nes-plugin.vala
+++ b/plugins/nes/src/nes-plugin.vala
@@ -17,14 +17,18 @@ private class Games.NesPlugin : Object, Plugin {
var fds_game_uri_adapter = new GenericSyncGameUriAdapter (fds_game_for_uri);
var nes_factory = new GenericUriGameFactory (nes_game_uri_adapter);
var fds_factory = new GenericUriGameFactory (fds_game_uri_adapter);
- var nes_query = new MimeTypeTrackerQuery (NES_MIME_TYPE, nes_factory);
- var fds_query = new MimeTypeTrackerQuery (FDS_MIME_TYPE, fds_factory);
+ var nes_query = new MimeTypeTrackerUriQuery (NES_MIME_TYPE);
+ var fds_query = new MimeTypeTrackerUriQuery (FDS_MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (nes_query);
- source.add_query (fds_query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (nes_query);
+ uri_source.add_query (fds_query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (nes_factory);
+ game_source.add_factory (fds_factory);
- return source;
+ return game_source;
}
private static Game nes_game_for_uri (string uri) throws Error {
diff --git a/plugins/nintendo-64/src/nintendo-64-plugin.vala b/plugins/nintendo-64/src/nintendo-64-plugin.vala
index df68204..082d76b 100644
--- a/plugins/nintendo-64/src/nintendo-64-plugin.vala
+++ b/plugins/nintendo-64/src/nintendo-64-plugin.vala
@@ -8,12 +8,15 @@ private class Games.Nintendo64Plugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/nintendo-ds/src/nintendo-ds-plugin.vala b/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
index 23529a9..56ecb66 100644
--- a/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
+++ b/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
@@ -8,12 +8,15 @@ private class Games.NintendoDsPlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/pc-engine/src/pc-engine-plugin.vala b/plugins/pc-engine/src/pc-engine-plugin.vala
index 4639c3d..69cd635 100644
--- a/plugins/pc-engine/src/pc-engine-plugin.vala
+++ b/plugins/pc-engine/src/pc-engine-plugin.vala
@@ -15,14 +15,18 @@ private class Games.PcEnginePlugin : Object, Plugin {
var cd_game_uri_adapter = new GenericSyncGameUriAdapter (cd_game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
var cd_factory = new GenericUriGameFactory (cd_game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
- var cd_query = new MimeTypeTrackerQuery (CUE_MIME_TYPE, cd_factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
+ var cd_query = new MimeTypeTrackerUriQuery (CUE_MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
- source.add_query (cd_query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ uri_source.add_query (cd_query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
+ game_source.add_factory (cd_factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/playstation/src/playstation-plugin.vala b/plugins/playstation/src/playstation-plugin.vala
index 3e555fd..0dc987b 100644
--- a/plugins/playstation/src/playstation-plugin.vala
+++ b/plugins/playstation/src/playstation-plugin.vala
@@ -1,16 +1,19 @@
// This file is part of GNOME Games. License: GPL-3.0+.
private class Games.PlayStation : Object, Plugin {
- private const string SEARCHED_MIME_TYPE = "application/x-cue";
+ private const string MIME_TYPE = "application/x-cue";
public GameSource get_game_source () throws Error {
var factory = new PlayStationGameFactory ();
- var query = new MimeTypeTrackerQuery (SEARCHED_MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
}
diff --git a/plugins/sega-saturn/src/sega-saturn-plugin.vala b/plugins/sega-saturn/src/sega-saturn-plugin.vala
index 2cea3e6..fccebf1 100644
--- a/plugins/sega-saturn/src/sega-saturn-plugin.vala
+++ b/plugins/sega-saturn/src/sega-saturn-plugin.vala
@@ -8,12 +8,15 @@ private class Games.SegaSaturnPlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (SEARCHED_MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (SEARCHED_MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/snes/src/snes-plugin.vala b/plugins/snes/src/snes-plugin.vala
index 1217d1a..dfc03bb 100644
--- a/plugins/snes/src/snes-plugin.vala
+++ b/plugins/snes/src/snes-plugin.vala
@@ -8,12 +8,15 @@ private class Games.SnesPlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/wii-ware/src/wii-ware-plugin.vala b/plugins/wii-ware/src/wii-ware-plugin.vala
index c689570..6285585 100644
--- a/plugins/wii-ware/src/wii-ware-plugin.vala
+++ b/plugins/wii-ware/src/wii-ware-plugin.vala
@@ -8,12 +8,15 @@ private class Games.WiiWarePlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
diff --git a/plugins/wii/src/wii-plugin.vala b/plugins/wii/src/wii-plugin.vala
index 188de46..38ee36c 100644
--- a/plugins/wii/src/wii-plugin.vala
+++ b/plugins/wii/src/wii-plugin.vala
@@ -7,12 +7,15 @@ private class Games.WiiPlugin : Object, Plugin {
public GameSource get_game_source () throws Error {
var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
var factory = new GenericUriGameFactory (game_uri_adapter);
- var query = new MimeTypeTrackerQuery (MIME_TYPE, factory);
+ var query = new MimeTypeTrackerUriQuery (MIME_TYPE);
var connection = Tracker.Sparql.Connection.@get ();
- var source = new TrackerGameSource (connection);
- source.add_query (query);
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+ var game_source = new GenericUriGameSource ();
+ game_source.add_source (uri_source);
+ game_source.add_factory (factory);
- return source;
+ return game_source;
}
private static Game game_for_uri (string uri) throws Error {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]