Support folder operations

Example:
  - add: a/b/c/d
  - delete: a/b/c/d
  - move: a/b/c/d -> a/b/c/d/e
This commit is contained in:
Bob Sun 2017-04-23 10:03:09 -07:00
parent b1ef8a343f
commit d8ecd1e889
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
8 changed files with 213 additions and 141 deletions

View file

@ -42,14 +42,6 @@ class AddPasswordTableViewController: PasswordEditorTableViewController {
Utils.alert(title: alertTitle, message: alertMessage, controller: self, completion: nil)
return false
}
// check "/"
guard nameCell.getContent()!.contains("/") == false else {
let alertTitle = "Cannot Add Password"
let alertMessage = "Illegal character."
Utils.alert(title: alertTitle, message: alertMessage, controller: self, completion: nil)
return false
}
}
return true
}
@ -73,7 +65,9 @@ class AddPasswordTableViewController: PasswordEditorTableViewController {
} else {
plainText = "\(cellContents["password"]!)"
}
password = Password(name: cellContents["name"]!, plainText: plainText)
let name = URL(string: cellContents["name"]!)!.lastPathComponent
let url = URL(string: cellContents["name"]!)!.appendingPathExtension("gpg")
password = Password(name: name, url: url, plainText: plainText)
}
}
}