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



commit e0241118a115ccfbfc521975917797604edb06b4
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Wed Sep 26 23:15:34 2018 +0500

    static

 src/ui/preferences-page-retro-platform.vala | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/ui/preferences-page-retro-platform.vala b/src/ui/preferences-page-retro-platform.vala
index 192e00e9..7ae2299e 100644
--- a/src/ui/preferences-page-retro-platform.vala
+++ b/src/ui/preferences-page-retro-platform.vala
@@ -18,6 +18,15 @@ private class Games.PreferencesPageRetroPlatform: Gtk.Bin, PreferencesPage {
        [GtkChild]
        private Gtk.ListBox core_list_box;
 
+       private static Retro.CoreDescriptor[] core_descriptors;
+
+       static construct {
+               var query = new Retro.ModuleQuery (true);
+               core_descriptors = {};
+               foreach (var core_descriptor in query)
+                       core_descriptors += core_descriptor;
+       }
+
        public PreferencesPageRetroPlatform (RetroPlatform platform) {
                this.platform = platform;
                _title = platform.get_name ();
@@ -26,8 +35,7 @@ private class Games.PreferencesPageRetroPlatform: Gtk.Bin, PreferencesPage {
        }
 
        private void build_core_list () {
-               var modules = new Retro.ModuleQuery (true);
-               foreach (var core_descriptor in modules) {
+               foreach (var core_descriptor in core_descriptors) {
                        try {
                                var platform_id = platform.get_id ();
                                var mime_types = platform.get_mime_types ();


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