change Globals class to static

This commit is contained in:
Bob Sun 2017-02-08 10:15:38 +08:00
parent 825cd5446d
commit f9e42b9490
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
7 changed files with 27 additions and 28 deletions

View file

@ -38,7 +38,7 @@ class Password {
extension PasswordEntity {
func decrypt() throws -> Password? {
var password: Password?
let encryptedDataPath = URL(fileURLWithPath: "\(Globals.shared.documentPath)/\(rawPath!)")
let encryptedDataPath = URL(fileURLWithPath: "\(Globals.documentPath)/\(rawPath!)")
let encryptedData = try Data(contentsOf: encryptedDataPath)
let decryptedData = try PasswordStore.shared.pgp.decryptData(encryptedData, passphrase: Defaults[.pgpKeyPassphrase])
let plain = String(data: decryptedData, encoding: .ascii) ?? ""