[gnome-games/wip/exalm/platform-preferences] d



commit bde83013b5c661ca08da0d657b587996d5b6bd10
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Thu Sep 27 22:45:57 2018 +0500

    d

 src/retro/retro-core-source.vala | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)
---
diff --git a/src/retro/retro-core-source.vala b/src/retro/retro-core-source.vala
index 21d10d2b..7eef31a2 100644
--- a/src/retro/retro-core-source.vala
+++ b/src/retro/retro-core-source.vala
@@ -48,32 +48,12 @@ public class Games.RetroCoreSource : Object {
        }
 
        private void search_module () throws Error {
-               var modules = new Retro.ModuleQuery (true);
-               foreach (var core_descriptor in modules) {
-                       try {
-                               var platform_id = platform.get_id ();
-                               var mime_types = platform.get_mime_types ();
+               var core_manager = new RetroCoreManager ();
 
-                               if (!core_descriptor.get_is_emulator ())
-                                       continue;
+               var core_descriptors = core_manager.get_cores_for_platform (platform);
 
-                               if (!core_descriptor.has_platform (platform_id))
-                                       continue;
-
-                               if (!core_descriptor.get_platform_supports_mime_types (platform_id, 
mime_types))
-                                       continue;
-
-                               if (core_descriptor.get_module_file () == null)
-                                       continue;
-
-                               this.core_descriptor = core_descriptor;
-
-                               break;
-                       }
-                       catch (Error e) {
-                               debug (e.message);
-                       }
-               }
+               if (core_descriptors.length > 0)
+                       core_descriptor = core_descriptors[0];
        }
 
        private void check_firmware_is_valid (string firmware) throws Error {


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