浏览代码

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

Naveenraj M 9 月之前
父节点
当前提交
f101cceca0
共有 2 个文件被更改,包括 1 次插入14 次删除
  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.">
         <record-type name="qemu argument" code="QeAr" description="QEMU argument configuration.">
           <property name="argument string" code="ArSt" type="text"
           <property name="argument string" code="ArSt" type="text"
             description="The QEMU argument as a string."/>
             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>
         
         
         <record-type name="apple configuration" code="ApCf" description="Apple virtual machine configuration.">
         <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
             "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
         return serializedArgument
     }
     }
     
     
@@ -522,12 +517,7 @@ extension UTMScriptingConfigImpl {
         let additionalArguments = records.compactMap { record -> QEMUArgument? in
         let additionalArguments = records.compactMap { record -> QEMUArgument? in
             guard let argumentString = record["argumentString"] as? String else { return nil }
             guard let argumentString = record["argumentString"] as? String else { return nil }
             var argument = QEMUArgument(argumentString)
             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
             return argument
         }
         }
         // Update entire additional arguments with new one.
         // Update entire additional arguments with new one.