[gnome-games/wip/aplazas/781334-refactor-game-source: 1/35] core: Make Plugin.get_game_source() nullable
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/781334-refactor-game-source: 1/35] core: Make Plugin.get_game_source() nullable
- Date: Thu, 4 May 2017 16:12:50 +0000 (UTC)
commit 4329646a2fe80b900d0bf08fe6ff0f9e2781cc15
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu May 4 14:00:07 2017 +0200
core: Make Plugin.get_game_source() nullable
This allow plugins to return no GameSource and will be used in a next
commit to allow them to directly expose URI sources and game factories.
plugins/amiga/src/amiga-plugin.vala | 2 +-
plugins/atari-2600/src/atari-2600-plugin.vala | 2 +-
plugins/atari-7800/src/atari-7800-plugin.vala | 2 +-
plugins/desktop/src/desktop-plugin.vala | 2 +-
plugins/doom/src/doom-plugin.vala | 2 +-
plugins/dreamcast/src/dreamcast-plugin.vala | 2 +-
.../src/game-boy-advance-plugin.vala | 2 +-
plugins/game-boy/src/game-boy-plugin.vala | 2 +-
plugins/game-cube/src/game-cube-plugin.vala | 2 +-
plugins/libretro/src/libretro-plugin.vala | 2 +-
plugins/love/src/love-plugin.vala | 2 +-
plugins/mame/src/mame-plugin.vala | 2 +-
.../master-system/src/master-system-plugin.vala | 2 +-
plugins/mega-drive/src/mega-drive-plugin.vala | 2 +-
.../neo-geo-pocket/src/neo-geo-pocket-plugin.vala | 2 +-
plugins/nes/src/nes-plugin.vala | 2 +-
plugins/nintendo-64/src/nintendo-64-plugin.vala | 2 +-
plugins/nintendo-ds/src/nintendo-ds-plugin.vala | 2 +-
plugins/pc-engine/src/pc-engine-plugin.vala | 2 +-
plugins/playstation/src/playstation-plugin.vala | 2 +-
plugins/sega-saturn/src/sega-saturn-plugin.vala | 2 +-
plugins/snes/src/snes-plugin.vala | 2 +-
plugins/steam/src/steam-plugin.vala | 2 +-
plugins/wii-ware/src/wii-ware-plugin.vala | 2 +-
plugins/wii/src/wii-plugin.vala | 2 +-
src/core/plugin.vala | 4 +++-
26 files changed, 28 insertions(+), 26 deletions(-)
---
diff --git a/plugins/amiga/src/amiga-plugin.vala b/plugins/amiga/src/amiga-plugin.vala
index 2b59a9b..1d50c8e 100644
--- a/plugins/amiga/src/amiga-plugin.vala
+++ b/plugins/amiga/src/amiga-plugin.vala
@@ -5,7 +5,7 @@ private class Games.AmigaPlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-amiga-disk-format";
private const string PLATFORM = "Amiga";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/atari-2600/src/atari-2600-plugin.vala b/plugins/atari-2600/src/atari-2600-plugin.vala
index a9f5cca..a687598 100644
--- a/plugins/atari-2600/src/atari-2600-plugin.vala
+++ b/plugins/atari-2600/src/atari-2600-plugin.vala
@@ -5,7 +5,7 @@ private class Games.Atari2600 : Object, Plugin {
private const string MIME_TYPE = "application/x-atari-2600-rom";
private const string PLATFORM = "Atari2600";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/atari-7800/src/atari-7800-plugin.vala b/plugins/atari-7800/src/atari-7800-plugin.vala
index 900fed3..4aea697 100644
--- a/plugins/atari-7800/src/atari-7800-plugin.vala
+++ b/plugins/atari-7800/src/atari-7800-plugin.vala
@@ -5,7 +5,7 @@ private class Games.Atari7800 : Object, Plugin {
private const string MIME_TYPE = "application/x-atari-7800-rom";
private const string PLATFORM = "Atari7800";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/desktop/src/desktop-plugin.vala b/plugins/desktop/src/desktop-plugin.vala
index 404393e..d472415 100644
--- a/plugins/desktop/src/desktop-plugin.vala
+++ b/plugins/desktop/src/desktop-plugin.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
private class Games.DesktopPlugin : Object, Plugin {
- public GameSource get_game_source () throws Error {
+ public GameSource? get_game_source () throws Error {
var connection = Tracker.Sparql.Connection.@get ();
var source = new TrackerGameSource (connection);
source.add_query (new DesktopTrackerQuery ());
diff --git a/plugins/doom/src/doom-plugin.vala b/plugins/doom/src/doom-plugin.vala
index 268c92f..d7271e2 100644
--- a/plugins/doom/src/doom-plugin.vala
+++ b/plugins/doom/src/doom-plugin.vala
@@ -5,7 +5,7 @@ private class Games.DoomPlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-doom-wad";
private const string PLATFORM = "DOOM";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/dreamcast/src/dreamcast-plugin.vala b/plugins/dreamcast/src/dreamcast-plugin.vala
index 5601097..972f891 100644
--- a/plugins/dreamcast/src/dreamcast-plugin.vala
+++ b/plugins/dreamcast/src/dreamcast-plugin.vala
@@ -4,7 +4,7 @@ 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 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);
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..8b5c8de 100644
--- a/plugins/game-boy-advance/src/game-boy-advance-plugin.vala
+++ b/plugins/game-boy-advance/src/game-boy-advance-plugin.vala
@@ -5,7 +5,7 @@ private class Games.GameBoyAdvancePlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-gba-rom";
private const string PLATFORM = "GameBoyAdvance";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/game-boy/src/game-boy-plugin.vala b/plugins/game-boy/src/game-boy-plugin.vala
index fcdb217..ba6b91d 100644
--- a/plugins/game-boy/src/game-boy-plugin.vala
+++ b/plugins/game-boy/src/game-boy-plugin.vala
@@ -10,7 +10,7 @@ private class Games.GameBoyPlugin : Object, Plugin {
private const string GAME_BOY_COLOR_MIME_TYPE = "application/x-gameboy-color-rom";
private const string GAME_BOY_COLOR_PLATFORM = "GameBoyColor";
- public GameSource get_game_source () throws Error {
+ public GameSource? get_game_source () throws Error {
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);
diff --git a/plugins/game-cube/src/game-cube-plugin.vala b/plugins/game-cube/src/game-cube-plugin.vala
index bdbe8a5..945bc57 100644
--- a/plugins/game-cube/src/game-cube-plugin.vala
+++ b/plugins/game-cube/src/game-cube-plugin.vala
@@ -4,7 +4,7 @@ private class Games.GameCubePlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-gamecube-rom";
private const string PLATFORM = "GameCube";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/libretro/src/libretro-plugin.vala b/plugins/libretro/src/libretro-plugin.vala
index 657dc45..f6f66bd 100644
--- a/plugins/libretro/src/libretro-plugin.vala
+++ b/plugins/libretro/src/libretro-plugin.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
private class Games.LibretroPlugin : Object, Plugin {
- public GameSource get_game_source () throws Error {
+ public GameSource? get_game_source () throws Error {
return new LibretroGameSource ();
}
}
diff --git a/plugins/love/src/love-plugin.vala b/plugins/love/src/love-plugin.vala
index c412f41..a6c983f 100644
--- a/plugins/love/src/love-plugin.vala
+++ b/plugins/love/src/love-plugin.vala
@@ -3,7 +3,7 @@
private class Games.LovePlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-love-game";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/mame/src/mame-plugin.vala b/plugins/mame/src/mame-plugin.vala
index 578c8dd..6e93279 100644
--- a/plugins/mame/src/mame-plugin.vala
+++ b/plugins/mame/src/mame-plugin.vala
@@ -3,7 +3,7 @@
private class Games.MamePlugin : Object, Plugin {
private const string SEARCHED_MIME_TYPE = "application/zip";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/master-system/src/master-system-plugin.vala
b/plugins/master-system/src/master-system-plugin.vala
index 6490362..3db80c0 100644
--- a/plugins/master-system/src/master-system-plugin.vala
+++ b/plugins/master-system/src/master-system-plugin.vala
@@ -13,7 +13,7 @@ private class Games.MasterSystemPlugin : Object, Plugin {
private const string SG_1000_MIME_TYPE = "application/x-sg1000-rom";
private const string SG_1000_PLATFORM = "SG1000";
- public GameSource get_game_source () throws Error {
+ 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);
// FIXME We should be able to use one factory for Master System and
diff --git a/plugins/mega-drive/src/mega-drive-plugin.vala b/plugins/mega-drive/src/mega-drive-plugin.vala
index 5592423..3663b4e 100644
--- a/plugins/mega-drive/src/mega-drive-plugin.vala
+++ b/plugins/mega-drive/src/mega-drive-plugin.vala
@@ -19,7 +19,7 @@ private class Games.MegaDrivePlugin : Object, Plugin {
private const string MEGA_CD_PLATFORM = "SegaCD";
private const string MEGA_CD_32X_PLATFORM = "SegaCD32X";
- public GameSource get_game_source () throws Error {
+ 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);
// FIXME We should be able to use one factory for Mega Drive and
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..74429ca 100644
--- a/plugins/neo-geo-pocket/src/neo-geo-pocket-plugin.vala
+++ b/plugins/neo-geo-pocket/src/neo-geo-pocket-plugin.vala
@@ -5,7 +5,7 @@ private class Games.NeoGeoPocketPlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-neo-geo-pocket-rom";
private const string PLATFORM = "NeoGeoPocket";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/nes/src/nes-plugin.vala b/plugins/nes/src/nes-plugin.vala
index 8fe52c7..a51fd5e 100644
--- a/plugins/nes/src/nes-plugin.vala
+++ b/plugins/nes/src/nes-plugin.vala
@@ -12,7 +12,7 @@ private class Games.NesPlugin : Object, Plugin {
private const string MODULE_BASENAME = "libretro-nes.so";
private const bool SUPPORTS_SNAPSHOTTING = true;
- public GameSource get_game_source () throws Error {
+ public GameSource? get_game_source () throws Error {
var nes_game_uri_adapter = new GenericSyncGameUriAdapter (nes_game_for_uri);
var fds_game_uri_adapter = new GenericSyncGameUriAdapter (fds_game_for_uri);
var nes_factory = new GenericUriGameFactory (nes_game_uri_adapter);
diff --git a/plugins/nintendo-64/src/nintendo-64-plugin.vala b/plugins/nintendo-64/src/nintendo-64-plugin.vala
index df68204..68add44 100644
--- a/plugins/nintendo-64/src/nintendo-64-plugin.vala
+++ b/plugins/nintendo-64/src/nintendo-64-plugin.vala
@@ -5,7 +5,7 @@ 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 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);
diff --git a/plugins/nintendo-ds/src/nintendo-ds-plugin.vala b/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
index 23529a9..93325ee 100644
--- a/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
+++ b/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
@@ -5,7 +5,7 @@ private class Games.NintendoDsPlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-nintendo-ds-rom";
private const string PLATFORM = "NintendoDS";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/pc-engine/src/pc-engine-plugin.vala b/plugins/pc-engine/src/pc-engine-plugin.vala
index 4639c3d..a3c2e50 100644
--- a/plugins/pc-engine/src/pc-engine-plugin.vala
+++ b/plugins/pc-engine/src/pc-engine-plugin.vala
@@ -10,7 +10,7 @@ private class Games.PcEnginePlugin : Object, Plugin {
private const string CD_MAGIC_VALUE = "PC Engine CD-ROM SYSTEM";
private const string CD_PLATFORM = "TurboGrafxCD";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/playstation/src/playstation-plugin.vala b/plugins/playstation/src/playstation-plugin.vala
index 3e555fd..e99a85a 100644
--- a/plugins/playstation/src/playstation-plugin.vala
+++ b/plugins/playstation/src/playstation-plugin.vala
@@ -3,7 +3,7 @@
private class Games.PlayStation : Object, Plugin {
private const string SEARCHED_MIME_TYPE = "application/x-cue";
- public GameSource get_game_source () throws Error {
+ public GameSource? get_game_source () throws Error {
var factory = new PlayStationGameFactory ();
var query = new MimeTypeTrackerQuery (SEARCHED_MIME_TYPE, factory);
var connection = Tracker.Sparql.Connection.@get ();
diff --git a/plugins/sega-saturn/src/sega-saturn-plugin.vala b/plugins/sega-saturn/src/sega-saturn-plugin.vala
index 2cea3e6..7d848e7 100644
--- a/plugins/sega-saturn/src/sega-saturn-plugin.vala
+++ b/plugins/sega-saturn/src/sega-saturn-plugin.vala
@@ -5,7 +5,7 @@ private class Games.SegaSaturnPlugin : Object, Plugin {
private const string SPECIFIC_MIME_TYPE = "application/x-saturn-rom";
private const string PLATFORM = "SegaSaturn";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/snes/src/snes-plugin.vala b/plugins/snes/src/snes-plugin.vala
index 1217d1a..e2a2530 100644
--- a/plugins/snes/src/snes-plugin.vala
+++ b/plugins/snes/src/snes-plugin.vala
@@ -5,7 +5,7 @@ private class Games.SnesPlugin : Object, Plugin {
private const string MIME_TYPE = "application/vnd.nintendo.snes.rom";
private const string PLATFORM = "SuperNintendoEntertainmentSystem";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/steam/src/steam-plugin.vala b/plugins/steam/src/steam-plugin.vala
index a9c46c3..e9a682f 100644
--- a/plugins/steam/src/steam-plugin.vala
+++ b/plugins/steam/src/steam-plugin.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
private class Games.SteamPlugin : Object, Plugin {
- public GameSource get_game_source () throws Error {
+ public GameSource? get_game_source () throws Error {
return new SteamGameSource ();
}
}
diff --git a/plugins/wii-ware/src/wii-ware-plugin.vala b/plugins/wii-ware/src/wii-ware-plugin.vala
index c689570..cae99b4 100644
--- a/plugins/wii-ware/src/wii-ware-plugin.vala
+++ b/plugins/wii-ware/src/wii-ware-plugin.vala
@@ -5,7 +5,7 @@ private class Games.WiiWarePlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-wii-wad";
private const string PLATFORM = "Wii";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/plugins/wii/src/wii-plugin.vala b/plugins/wii/src/wii-plugin.vala
index 188de46..9162605 100644
--- a/plugins/wii/src/wii-plugin.vala
+++ b/plugins/wii/src/wii-plugin.vala
@@ -4,7 +4,7 @@ private class Games.WiiPlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-wii-rom";
private const string PLATFORM = "WiiWare";
- public GameSource get_game_source () throws Error {
+ 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);
diff --git a/src/core/plugin.vala b/src/core/plugin.vala
index fa72b70..0658cc9 100644
--- a/src/core/plugin.vala
+++ b/src/core/plugin.vala
@@ -1,5 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
public interface Games.Plugin : Object {
- public abstract GameSource get_game_source () throws Error;
+ public virtual GameSource? get_game_source () throws Error {
+ return null;
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]