[gnome-games/wip/exalm/rebrand: 63/124] platform: Make autodiscovery a property




commit 6eda319b2f1a4d40b0154ef0957565965adc14ed
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Mar 30 01:37:44 2021 +0500

    platform: Make autodiscovery a property

 plugins/ms-dos/src/ms-dos-plugin.vala | 3 ++-
 src/core/platform.vala                | 8 +++-----
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/plugins/ms-dos/src/ms-dos-plugin.vala b/plugins/ms-dos/src/ms-dos-plugin.vala
index a8905e05..a9e3eb19 100644
--- a/plugins/ms-dos/src/ms-dos-plugin.vala
+++ b/plugins/ms-dos/src/ms-dos-plugin.vala
@@ -9,7 +9,8 @@ private class Games.MsDosPlugin : Object, Plugin {
        private static Platform platform;
 
        static construct {
-               platform = new Platform (PLATFORM_ID, PLATFORM_NAME, MIME_TYPE, PLATFORM_UID_PREFIX, false);
+               platform = new Platform (PLATFORM_ID, PLATFORM_NAME, MIME_TYPE, PLATFORM_UID_PREFIX);
+               platform.autodiscovery = false;
        }
 
        public Platform[] get_platforms () {
diff --git a/src/core/platform.vala b/src/core/platform.vala
index 39bcf322..7c4aa435 100644
--- a/src/core/platform.vala
+++ b/src/core/platform.vala
@@ -7,24 +7,22 @@ public class Games.Platform : Object {
        private string presentation_mime_type;
        private string prefix;
 
-       public bool autodiscovery { get; private set; }
+       public bool autodiscovery { get; set; }
 
-       public Platform (string id, string name,  string mime_type, string prefix, bool autodiscovery = true) 
{
+       public Platform (string id, string name,  string mime_type, string prefix) {
                this.id = id;
                this.name = name;
                this.mime_types = { mime_type };
                this.presentation_mime_type = mime_type;
                this.prefix = prefix;
-               this.autodiscovery = autodiscovery;
        }
 
-       public Platform.with_mime_types (string id, string name, string[] mime_types, string 
presentation_mime_type, string prefix, bool autodiscovery = true) {
+       public Platform.with_mime_types (string id, string name, string[] mime_types, string 
presentation_mime_type, string prefix) {
                this.id = id;
                this.name = name;
                this.mime_types = mime_types;
                this.presentation_mime_type = presentation_mime_type;
                this.prefix = prefix;
-               this.autodiscovery = autodiscovery;
        }
 
        public string get_id () {


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