[gnome-games] Use one generic factory per query



commit 5f3aaf623e7794687f64020e53eaf9dc0a723ac6
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Aug 19 16:07:52 2016 +0200

    Use one generic factory per query
    
    This avoids Master System, Game Gear, Mega Drive and 32X games to appear
    twice.

 .../master-system/src/master-system-plugin.vala    |    9 ++++++---
 plugins/mega-drive/src/mega-drive-plugin.vala      |    9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/plugins/master-system/src/master-system-plugin.vala 
b/plugins/master-system/src/master-system-plugin.vala
index 0d0b3dc..03c7168 100644
--- a/plugins/master-system/src/master-system-plugin.vala
+++ b/plugins/master-system/src/master-system-plugin.vala
@@ -16,10 +16,13 @@ private class Games.MasterSystemPlugin : Object, Plugin {
        public GameSource get_game_source () throws Error {
                var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
                var sg_1000_game_uri_adapter = new GenericSyncGameUriAdapter (sg_1000_game_for_uri);
-               var factory = new GenericUriGameFactory (game_uri_adapter);
+               // FIXME We should be able to use one factory for Master System and
+               // Game Gear.
+               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, factory);
-               var game_gear_query = new MimeTypeTrackerQuery (GAME_GEAR_MIME_TYPE, factory);
+               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 connection = Tracker.Sparql.Connection.@get ();
                var source = new TrackerGameSource (connection);
diff --git a/plugins/mega-drive/src/mega-drive-plugin.vala b/plugins/mega-drive/src/mega-drive-plugin.vala
index e386387..5dd2378 100644
--- a/plugins/mega-drive/src/mega-drive-plugin.vala
+++ b/plugins/mega-drive/src/mega-drive-plugin.vala
@@ -20,10 +20,13 @@ private class Games.MegaDrivePlugin : Object, Plugin {
        public GameSource get_game_source () throws Error {
                var game_uri_adapter = new GenericSyncGameUriAdapter (game_for_uri);
                var cd_game_uri_adapter = new GenericSyncGameUriAdapter (cd_game_for_uri);
-               var factory = new GenericUriGameFactory (game_uri_adapter);
+               // FIXME We should be able to use one factory for Mega Drive and
+               // 32X.
+               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, factory);
-               var 32x_query = new MimeTypeTrackerQuery (32X_MIME_TYPE, factory);
+               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 connection = Tracker.Sparql.Connection.@get ();
                var source = new TrackerGameSource (connection);


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