[gnome-boxes/offer-download-of-supported-archs-only: 2/3] installed-media: Make supported archs globally available



commit 941be304307e71a8f3d62edd227e615cf175b68c
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Apr 5 16:48:33 2018 +0200

    installed-media: Make supported archs globally available
    
    So we can consult it across the codebase.

 src/installed-media.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/installed-media.vala b/src/installed-media.vala
index 67e3518f..09ceffdf 100644
--- a/src/installed-media.vala
+++ b/src/installed-media.vala
@@ -11,6 +11,9 @@
                                                    ".vmdk", ".vmdk.gz",
                                                    ".vpc", ".vpc.gz",
                                                    ".cloop", ".cloop.gz" };
+    public const string[] supported_architectures = {
+        "i686", "i586", "i486", "i386"
+    };
     private static Regex date_regex = /20[0-9]{6,6}/;
 
     public override bool need_user_input_for_vm_creation { get { return false; } }
@@ -23,8 +26,7 @@
             if (device_file.contains ("amd64") || device_file.contains ("x86_64"))
                 return "x86_64";
             else {
-                string[] arch_list = { "i686", "i586", "i486", "i386" };
-                foreach (var arch in arch_list) {
+                foreach (var arch in supported_architectures) {
                     if (device_file.contains (arch))
                         return arch;
                 }


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