[gnome-games/wip/exalm/platform-preferences: 21/46] application: Register platforms for libretro simple types
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/platform-preferences: 21/46] application: Register platforms for libretro simple types
- Date: Wed, 20 Feb 2019 17:45:16 +0000 (UTC)
commit 8b1daf0d70143b11c82a2a220a80f2a8d547773a
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sun May 20 21:37:59 2018 +0000
application: Register platforms for libretro simple types
src/retro/retro-simple-game-uri-adapter.vala | 6 ++----
src/ui/application.vala | 7 ++++++-
2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/retro/retro-simple-game-uri-adapter.vala b/src/retro/retro-simple-game-uri-adapter.vala
index afb0a1f1..f7e9e1ea 100644
--- a/src/retro/retro-simple-game-uri-adapter.vala
+++ b/src/retro/retro-simple-game-uri-adapter.vala
@@ -4,11 +4,9 @@ private class Games.RetroSimpleGameUriAdapter : GameUriAdapter, Object {
private RetroSimpleType simple_type;
private Platform platform;
- public RetroSimpleGameUriAdapter (RetroSimpleType simple_type) {
+ public RetroSimpleGameUriAdapter (RetroSimpleType simple_type, Platform platform) {
this.simple_type = simple_type;
-
- var platform_name = simple_type.get_platform_name ();
- platform = new GenericPlatform (simple_type.platform, platform_name);
+ this.platform = platform;
}
public async Game game_for_uri (Uri uri) throws Error {
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 4dcecb6c..6dddb3d2 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -272,6 +272,7 @@ public class Games.Application : Gtk.Application {
game_collection.add_source (tracker_uri_source);
var mime_types = new GenericSet<string> (str_hash, str_equal);
+ var platform_register = PlatformRegister.get_register ();
/* Register simple Libretro-based game types */
foreach (var simple_type in RETRO_SIMPLE_TYPES) {
@@ -283,7 +284,11 @@ public class Games.Application : Gtk.Application {
tracker_uri_source.add_query (query);
}
- var game_uri_adapter = new RetroSimpleGameUriAdapter (simple_type);
+ var platform_name = simple_type.get_platform_name ();
+ var platform = new GenericPlatform (simple_type.platform, platform_name);
+ platform_register.add_platform (platform);
+
+ var game_uri_adapter = new RetroSimpleGameUriAdapter (simple_type, platform);
var factory = new GenericUriGameFactory (game_uri_adapter);
factory.add_mime_type (simple_type.mime_type);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]