mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-25 17:57:41 +00:00
define and use the constant InstallableConstants.defaultVersion instead of a magic string
This commit is contained in:
parent
7e3e6adfb8
commit
27f3736bee
2 changed files with 6 additions and 2 deletions
|
|
@ -1221,7 +1221,7 @@ public class Manager: NSObject, HTTPDownloadDelegate, UIGestureRecognizerDelegat
|
|||
downloadQueue!.userInfo = commonUserData
|
||||
|
||||
let request = HTTPDownloadRequest(url: lexicalModelURL, userInfo: commonUserData)
|
||||
request.destinationFile = Storage.active.lexicalModelURL(forID: lexicalModel.id, version: lexicalModel.version ?? "0.1.0").path
|
||||
request.destinationFile = Storage.active.lexicalModelURL(forID: lexicalModel.id, version: lexicalModel.version ?? InstallableConstants.defaultVersion).path
|
||||
request.tag = 0
|
||||
|
||||
downloadQueue!.addRequest(request)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
struct InstallableConstants {
|
||||
static let defaultVersion = "0.1.0"
|
||||
}
|
||||
|
||||
/// Mainly differs from the API `LexicalModel` by having an associated language.
|
||||
public struct InstallableLexicalModel: Codable {
|
||||
public var id: String
|
||||
|
|
@ -38,7 +42,7 @@ public struct InstallableLexicalModel: Codable {
|
|||
self.name = lexicalModel.name
|
||||
self.languageID = languageID
|
||||
// self.languageName = language.name
|
||||
self.version = lexicalModel.version ?? "0.1.0"
|
||||
self.version = lexicalModel.version ?? InstallableConstants.defaultVersion
|
||||
self.isCustom = isCustom
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue