瀏覽代碼

scripting: change property name
Avoid using reserved keyword in AppleScript as property name

Naveenraj M 10 月之前
父節點
當前提交
7c8f656592
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      Scripting/UTM.sdef
  2. 2 2
      Scripting/UTMScriptingConfigImpl.swift

+ 1 - 1
Scripting/UTM.sdef

@@ -540,7 +540,7 @@
         </record-type>
         </record-type>
         
         
         <record-type name="qemu argument" code="QeAr" description="QEMU argument configuration.">
         <record-type name="qemu argument" code="QeAr" description="QEMU argument configuration.">
-          <property name="string" code="StAg" 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"
           <property name="file urls" code="FlUr" type="file" list="yes"

+ 2 - 2
Scripting/UTMScriptingConfigImpl.swift

@@ -191,7 +191,7 @@ extension UTMScriptingConfigImpl {
     
     
     private func serializeQemuAdditionalArgument(_ argument: QEMUArgument) -> [AnyHashable: Any] {
     private func serializeQemuAdditionalArgument(_ argument: QEMUArgument) -> [AnyHashable: Any] {
         var serializedArgument: [AnyHashable: Any] = [
         var serializedArgument: [AnyHashable: Any] = [
-            "string": argument.string
+            "argumentString": argument.string
         ]
         ]
         
         
         // Only add fileUrls if it is not nil and contains URLs
         // Only add fileUrls if it is not nil and contains URLs
@@ -520,7 +520,7 @@ extension UTMScriptingConfigImpl {
     private func updateQemuAdditionalArguments(from records: [[AnyHashable: Any]]) throws {
     private func updateQemuAdditionalArguments(from records: [[AnyHashable: Any]]) throws {
         let config = config as! UTMQemuConfiguration
         let config = config as! UTMQemuConfiguration
         let additionalArguments = records.compactMap { record -> QEMUArgument? in
         let additionalArguments = records.compactMap { record -> QEMUArgument? in
-            guard let argumentString = record["string"] 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
             // Qemu Additional Arguments in UI, only takes strings
             // So, fileUrls of arguments will never be used
             // So, fileUrls of arguments will never be used