[gnome-games/wip/exalm/platform-preferences: 70/76] static



commit 5cd1a37bbb7d4e3f78323e4528ed4f8959e60024
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 a8eefa58..e2ee08b4 100644
--- a/src/ui/preferences-page-retro-platform.vala
+++ b/src/ui/preferences-page-retro-platform.vala
@@ -7,6 +7,15 @@ private class Games.PreferencesPageRetroPlatform: 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 ();
@@ -16,8 +25,7 @@ private class Games.PreferencesPageRetroPlatform: 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]