Retain original filename as imported profile name (#240)
This commit is contained in:
parent
dad6d820e9
commit
22c28de641
|
@ -49,7 +49,7 @@ extension AddHostView {
|
|||
return
|
||||
}
|
||||
isNamePreset = true
|
||||
profileName = url.normalizedFilename
|
||||
profileName = url.filename
|
||||
}
|
||||
|
||||
@MainActor
|
||||
|
|
|
@ -32,11 +32,8 @@ import AppKit
|
|||
#endif
|
||||
|
||||
extension URL {
|
||||
private static let illegalCharacterFallback = "_"
|
||||
|
||||
public var normalizedFilename: String {
|
||||
let filename = deletingPathExtension().lastPathComponent
|
||||
return filename.components(separatedBy: CharacterSet.filename.inverted).joined(separator: URL.illegalCharacterFallback)
|
||||
public var filename: String {
|
||||
deletingPathExtension().lastPathComponent
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
|
|
Loading…
Reference in New Issue