Changes for IDNA support

This commit is contained in:
Nate Weaver 2020-07-06 10:06:12 -05:00
parent 9bd6f9e0fd
commit 1f9dfb80e2
5 changed files with 9 additions and 9 deletions

View File

@ -126,11 +126,11 @@ private extension WebFeedInspectorViewController {
}
func updateHomePageURL() {
homePageURLTextField?.stringValue = feed?.homePageURL ?? ""
homePageURLTextField?.stringValue = feed?.homePageURL?.decodedURLString ?? ""
}
func updateFeedURL() {
urlTextField?.stringValue = feed?.url ?? ""
urlTextField?.stringValue = feed?.url.decodedURLString ?? ""
}
func updateNotifyAboutNewArticles() {

View File

@ -91,7 +91,7 @@ class AddWebFeedWindowController : NSWindowController, AddFeedWindowController {
cancelSheet()
return;
}
guard let url = URL(string: normalizedURLString) else {
guard let url = URL(unicodeString: normalizedURLString) else {
cancelSheet()
return
}

View File

@ -145,16 +145,16 @@ private extension SidebarViewController {
}
if let homePageURL = webFeed.homePageURL, let _ = URL(string: homePageURL) {
let item = menuItem(NSLocalizedString("Open Home Page", comment: "Command"), #selector(openHomePageFromContextualMenu(_:)), homePageURL)
let item = menuItem(NSLocalizedString("Open Home Page", comment: "Command"), #selector(openHomePageFromContextualMenu(_:)), homePageURL.decodedURLString ?? homePageURL)
menu.addItem(item)
menu.addItem(NSMenuItem.separator())
}
let copyFeedURLItem = menuItem(NSLocalizedString("Copy Feed URL", comment: "Command"), #selector(copyURLFromContextualMenu(_:)), webFeed.url)
let copyFeedURLItem = menuItem(NSLocalizedString("Copy Feed URL", comment: "Command"), #selector(copyURLFromContextualMenu(_:)), webFeed.url.decodedURLString ?? webFeed.url)
menu.addItem(copyFeedURLItem)
if let homePageURL = webFeed.homePageURL {
let item = menuItem(NSLocalizedString("Copy Home Page URL", comment: "Command"), #selector(copyURLFromContextualMenu(_:)), homePageURL)
let item = menuItem(NSLocalizedString("Copy Home Page URL", comment: "Command"), #selector(copyURLFromContextualMenu(_:)), homePageURL.decodedURLString ?? homePageURL)
menu.addItem(item)
}
menu.addItem(NSMenuItem.separator())

View File

@ -92,7 +92,7 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
let urlString = urlTextField.text ?? ""
let normalizedURLString = urlString.normalizedURL
guard !normalizedURLString.isEmpty, let url = URL(string: normalizedURLString) else {
guard !normalizedURLString.isEmpty, let url = URL(unicodeString: normalizedURLString) else {
delegate?.processingDidCancel()
return
}

View File

@ -50,8 +50,8 @@ class WebFeedInspectorViewController: UITableViewController {
notifyAboutNewArticlesSwitch.setOn(webFeed.isNotifyAboutNewArticles ?? false, animated: false)
alwaysShowReaderViewSwitch.setOn(webFeed.isArticleExtractorAlwaysOn ?? false, animated: false)
homePageLabel.text = webFeed.homePageURL
feedURLLabel.text = webFeed.url
homePageLabel.text = webFeed.homePageURL?.decodedURLString
feedURLLabel.text = webFeed.url.decodedURLString
NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .WebFeedIconDidBecomeAvailable, object: nil)