[gnome-games] retro: Adapt to changes in Retro.ModuleQuery
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] retro: Adapt to changes in Retro.ModuleQuery
- Date: Sun, 26 Feb 2017 13:21:18 +0000 (UTC)
commit 7491212a730eb59006d872c4aebd6d9b5695191f
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sun Feb 26 14:10:25 2017 +0100
retro: Adapt to changes in Retro.ModuleQuery
Use foreach instead of foreach_core_descriptor() to search a module.
Also use CoreDescriptor.get_platform_supports_mime_types().
src/retro/retro-core-source.vala | 35 +++++++++++++++--------------------
1 files changed, 15 insertions(+), 20 deletions(-)
---
diff --git a/src/retro/retro-core-source.vala b/src/retro/retro-core-source.vala
index 7a0b826..64c43c3 100644
--- a/src/retro/retro-core-source.vala
+++ b/src/retro/retro-core-source.vala
@@ -40,30 +40,25 @@ public class Games.RetroCoreSource : Object {
}
private void search_module () throws Error {
- Retro.ModuleQuery.foreach_core_descriptor (parse_core_descriptor);
- }
-
- private bool parse_core_descriptor (Retro.CoreDescriptor core_descriptor) {
- try {
- if (!core_descriptor.get_is_emulator ())
- return false;
+ var modules = new Retro.ModuleQuery ();
+ foreach (var core_descriptor in modules) {
+ try {
+ if (!core_descriptor.get_is_emulator ())
+ continue;
- if (!core_descriptor.has_platform (platform))
- return false;
+ if (!core_descriptor.has_platform (platform))
+ continue;
- var supported_mime_types = core_descriptor.get_mime_type (platform);
- foreach (var mime_type in mime_types)
- if (!(mime_type in supported_mime_types))
- return false;
+ if (!core_descriptor.get_platform_supports_mime_types (platform, mime_types))
+ continue;
- this.core_descriptor = core_descriptor;
-
- return true;
- }
- catch (Error e) {
- debug (e.message);
+ this.core_descriptor = core_descriptor;
- return false;
+ break;
+ }
+ catch (Error e) {
+ debug (e.message);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]