Continue to fix build errors.
This commit is contained in:
parent
6631a9c2f8
commit
0336e30b0d
|
@ -43,8 +43,21 @@ private func accountAndArticlesDictionary(_ articles: Set<Article>) -> [String:
|
|||
|
||||
extension Article {
|
||||
|
||||
func preferredLink() -> String? {
|
||||
|
||||
return url ?? externalURL
|
||||
var status: ArticleStatus? {
|
||||
get {
|
||||
return account?.articleStatus(for: self)
|
||||
}
|
||||
}
|
||||
|
||||
var preferredLink: String? {
|
||||
get {
|
||||
return url ?? externalURL
|
||||
}
|
||||
}
|
||||
|
||||
var body: String? {
|
||||
get {
|
||||
return contentHTML ?? contentText ?? summary
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,8 +138,7 @@ class ArticleRenderer {
|
|||
|
||||
private func titleOrTitleLink() -> String {
|
||||
|
||||
let link = preferredLink(for: article)
|
||||
if let link = link {
|
||||
if let link = article.preferredLink {
|
||||
return linkWithText(title, link)
|
||||
}
|
||||
return title
|
||||
|
|
|
@ -24,7 +24,7 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
|||
|
||||
detailSplitViewItem?.minimumThickness = 384
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(applicationWillTerminate(_:)), name: .NSApplicationWillTerminate, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(applicationWillTerminate(_:)), name: NSApplication.willTerminateNotification, object: nil)
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appNavigationKeyPressed(_:)), name: .AppNavigationKeyPressed, object: nil)
|
||||
|
||||
|
@ -174,7 +174,7 @@ private extension MainWindowController {
|
|||
var currentLink: String? {
|
||||
get {
|
||||
if let article = oneSelectedArticle {
|
||||
return preferredLink(for: article)
|
||||
return article.preferredLink
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -91,8 +91,7 @@ private extension StatusBarView {
|
|||
return
|
||||
}
|
||||
|
||||
let s = article.preferredLink()
|
||||
if let s = s {
|
||||
if let s = article.preferredLink {
|
||||
urlLabel.stringValue = (s as NSString).rs_stringByStrippingHTTPOrHTTPSScheme()
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -103,16 +103,16 @@ private func attributedTitleString(_ title: String, _ text: String, _ appearance
|
|||
|
||||
if !title.isEmpty && !text.isEmpty {
|
||||
|
||||
let titleMutable = NSMutableAttributedString(string: title, attributes: [NSForegroundColorAttributeName: appearance.titleColor, NSFontAttributeName: appearance.titleFont])
|
||||
let attributedText = NSAttributedString(string: "\n" + text, attributes: [NSForegroundColorAttributeName: appearance.textColor, NSFontAttributeName: appearance.textFont])
|
||||
let titleMutable = NSMutableAttributedString(string: title, attributes: [NSAttributedStringKey.foregroundColor: appearance.titleColor, NSAttributedStringKey.font: appearance.titleFont])
|
||||
let attributedText = NSAttributedString(string: "\n" + text, attributes: [NSAttributedStringKey.foregroundColor: appearance.textColor, NSAttributedStringKey.font: appearance.textFont])
|
||||
titleMutable.append(attributedText)
|
||||
return titleMutable
|
||||
}
|
||||
|
||||
if !title.isEmpty && text.isEmpty {
|
||||
return NSAttributedString(string: title, attributes: [NSForegroundColorAttributeName: appearance.titleColor, NSFontAttributeName: appearance.titleFont])
|
||||
return NSAttributedString(string: title, attributes: [NSAttributedStringKey.foregroundColor: appearance.titleColor, NSAttributedStringKey.font: appearance.titleFont])
|
||||
}
|
||||
|
||||
return NSAttributedString(string: text, attributes: [NSForegroundColorAttributeName: appearance.textColor, NSFontAttributeName: appearance.textFont])
|
||||
return NSAttributedString(string: text, attributes: [NSAttributedStringKey.foregroundColor: appearance.textColor, NSAttributedStringKey.font: appearance.textFont])
|
||||
}
|
||||
|
||||
|
|
|
@ -135,10 +135,7 @@ class TimelineViewController: NSViewController, NSTableViewDelegate, NSTableView
|
|||
|
||||
@objc func openArticleInBrowser(_ sender: AnyObject) {
|
||||
|
||||
guard let article = oneSelectedArticle else {
|
||||
return
|
||||
}
|
||||
if let link = preferredLink(for: article) {
|
||||
if let link = oneSelectedArticle?.preferredLink {
|
||||
openInBrowser(link)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,11 @@ public final class Account: DisplayNameProvider, Hashable {
|
|||
// TODO
|
||||
}
|
||||
|
||||
public func articleStatus(for article: Article) -> ArticleStatus? {
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
public func ensureFolder(with name: String) -> Folder? {
|
||||
|
||||
return nil //TODO
|
||||
|
|
Loading…
Reference in New Issue