Explorar o código

scripting: drop file urls from qemu arguments
If file urls were be supported, handle file permissions before use (app sandbox)

Naveenraj M hai 9 meses
pai
achega
f101cceca0
Modificáronse 2 ficheiros con 1 adicións e 14 borrados
  1. 0 3
      Scripting/UTM.sdef
  2. 1 11
      Scripting/UTMScriptingConfigImpl.swift

+ 0 - 3
Scripting/UTM.sdef

@@ -542,9 +542,6 @@
         <record-type name="qemu argument" code="QeAr" description="QEMU argument configuration.">
           <property name="argument string" code="ArSt" type="text"
             description="The QEMU argument as a string."/>
-            
-          <property name="file urls" code="FlUr" type="file" list="yes"
-            description="Optional URLs associated with this argument."/>
         </record-type>
         
         <record-type name="apple configuration" code="ApCf" description="Apple virtual machine configuration.">

+ 1 - 11
Scripting/UTMScriptingConfigImpl.swift

@@ -194,11 +194,6 @@ extension UTMScriptingConfigImpl {
             "argumentString": argument.string
         ]
         
-        // Only add fileUrls if it is not nil and contains URLs
-        if let fileUrls = argument.fileUrls, !fileUrls.isEmpty {
-            serializedArgument["fileUrls"] = fileUrls.map({ $0 as AnyHashable })
-        }
-        
         return serializedArgument
     }
     
@@ -522,12 +517,7 @@ extension UTMScriptingConfigImpl {
         let additionalArguments = records.compactMap { record -> QEMUArgument? in
             guard let argumentString = record["argumentString"] as? String else { return nil }
             var argument = QEMUArgument(argumentString)
-            // Qemu Additional Arguments in UI, only takes strings
-            // So, fileUrls of arguments will never be used
-            // This is here if they support in future
-            if let fileUrls = record["fileUrls"] as? [URL] {
-                argument.fileUrls = fileUrls
-            }
+            
             return argument
         }
         // Update entire additional arguments with new one.