[gnome-games/wip/exalm/rebrand: 62/124] retro-simple-game-uri-adapter: Don't depend on RetroSimpleType
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/rebrand: 62/124] retro-simple-game-uri-adapter: Don't depend on RetroSimpleType
- Date: Sat, 19 Jun 2021 14:37:45 +0000 (UTC)
commit 2ab72e4e85d1ea05e6d55876dea2b5bd838e16f5
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Mar 30 01:33:31 2021 +0500
retro-simple-game-uri-adapter: Don't depend on RetroSimpleType
src/retro/retro-simple-game-uri-adapter.vala | 8 +++-----
src/ui/application.vala | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/retro/retro-simple-game-uri-adapter.vala b/src/retro/retro-simple-game-uri-adapter.vala
index ca383334..05acad84 100644
--- a/src/retro/retro-simple-game-uri-adapter.vala
+++ b/src/retro/retro-simple-game-uri-adapter.vala
@@ -1,18 +1,16 @@
// This file is part of GNOME Games. License: GPL-3.0+.
private class Games.RetroSimpleGameUriAdapter : GameUriAdapter, Object {
- private RetroSimpleType simple_type;
private Platform platform;
- public RetroSimpleGameUriAdapter (RetroSimpleType simple_type, Platform platform) {
- this.simple_type = simple_type;
+ public RetroSimpleGameUriAdapter (Platform platform) {
this.platform = platform;
}
public Game game_for_uri (Uri uri) throws Error {
- var uid = new Uid (Fingerprint.get_uid (uri, simple_type.prefix));
+ var uid = new Uid (Fingerprint.get_uid (uri, platform.get_uid_prefix ()));
var title = new FilenameTitle (uri);
- var media = new GriloMedia (title, simple_type.mime_type);
+ var media = new GriloMedia (title, platform.get_presentation_mime_type ());
var cover = new CompositeCover ({
new LocalCover (uri),
new GriloCover (media, uid)});
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 9d8a5b01..4a150130 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -463,7 +463,7 @@ public class Games.Application : Gtk.Application {
var platform = new Platform (simple_type.platform, platform_name,
simple_type.mime_type, simple_type.prefix);
platform_register.add_platform (platform);
- var game_uri_adapter = new RetroSimpleGameUriAdapter (simple_type, platform);
+ var game_uri_adapter = new RetroSimpleGameUriAdapter (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]