[gnome-games] retro-core: Use RetroFirmware object



commit 4d8d66b20f9bb222a21655d9c75e96cdb162f96d
Author: Adwait Rawat <adwait rawat gmail com>
Date:   Mon Jun 22 21:02:23 2020 +0900

    retro-core: Use RetroFirmware object

 src/retro/retro-core.vala | 32 +++++---------------------------
 1 file changed, 5 insertions(+), 27 deletions(-)
---
diff --git a/src/retro/retro-core.vala b/src/retro/retro-core.vala
index d97099b8..385b3ebc 100644
--- a/src/retro/retro-core.vala
+++ b/src/retro/retro-core.vala
@@ -7,35 +7,13 @@ private class Games.RetroCore : Object, Core {
                this.core_descriptor = core_descriptor;
        }
 
-       public string[] get_all_firmware (Platform platform) throws Error {
+       public Firmware[] get_all_firmware (Platform platform) throws Error {
                var platform_id = platform.get_id ();
+               Firmware[] firmware_list = {};
                if (core_descriptor.has_firmwares (platform_id))
-                       return core_descriptor.get_firmwares (platform_id);
-               else
-                       return {};
-       }
-
-       public bool has_firmware_md5 (string firmware) throws Error {
-               return core_descriptor.has_firmware_md5 (firmware);
-       }
-
-       public bool has_firmware_sha512 (string firmware) throws Error {
-               return core_descriptor.has_firmware_sha512 (firmware);
-       }
-
-       public string? get_firmware_md5 (string firmware) throws Error {
-               return core_descriptor.get_firmware_md5 (firmware);
-       }
-
-       public string? get_firmware_sha512 (string firmware) throws Error {
-               return core_descriptor.get_firmware_sha512 (firmware);
-       }
-
-       public bool get_is_firmware_mandatory (string firmware) throws Error {
-               return core_descriptor.get_is_firmware_mandatory (firmware);
-       }
+                       foreach (var firmware in core_descriptor.get_firmwares (platform_id))
+                               firmware_list += new RetroFirmware (firmware, core_descriptor);
 
-       public string? get_firmware_path (string firmware) throws Error {
-               return core_descriptor.get_firmware_path (firmware);
+               return firmware_list;
        }
 }


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