Continue fixing build errors.

This commit is contained in:
Brent Simmons 2017-09-17 17:56:04 -07:00
parent c74201d163
commit 54ca352a70
6 changed files with 15 additions and 13 deletions

View File

@ -66,7 +66,12 @@ struct TimelineCellData {
self.showFeedName = showFeedName
self.favicon = nil
self.read = article.read
if let status = article.status {
self.read = status.read
}
else {
self.read = false
}
}
init() { //Empty

View File

@ -414,7 +414,7 @@ class TimelineViewController: NSViewController, NSTableViewDelegate, NSTableView
var fetchedArticles = [Article]()
for (accountID, objects) in accountsDictionary {
guard let oneAccount = AccountManager.sharedInstance.existingAccountWithIdentifier(accountID) else {
guard let oneAccount = account(with: accountID) else {
continue
}
@ -437,11 +437,8 @@ class TimelineViewController: NSViewController, NSTableViewDelegate, NSTableView
private func calculateRowHeight() -> CGFloat {
let prototypeArticle = LocalArticle(account: AccountManager.sharedInstance.localAccount, feedID: "prototype", articleID: "prototype")
prototypeArticle.title = "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
let prototypeArticleStatus = LocalArticleStatus(articleID: "prototype", read: false, starred: false, userDeleted: false, dateArrived: Date())
prototypeArticle.status = prototypeArticleStatus
let longTitle = "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
let prototypeArticle = Article(accountID: "prototype", articleID: "prototype", feedID: "prototype", uniqueID: "prototype", title: longTitle, contentHTML: nil, contentText: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, bannerImageURL: nil, datePublished: nil, dateModified: nil, authors: nil, tags: nil, attachments: nil, accountInfo: nil)
let prototypeCellData = TimelineCellData(article: prototypeArticle, appearance: cellAppearance, showFeedName: false)
let height = timelineCellHeight(100, cellData: prototypeCellData, appearance: cellAppearance)

View File

@ -75,7 +75,7 @@ public final class AccountManager: UnreadCountProvider {
// MARK: API
public func existingAccountWithID(_ accountID: String) -> Account? {
public func existingAccount(with accountID: String) -> Account? {
return accountsDictionary[accountID]
}
@ -191,10 +191,10 @@ private func accountFilePathWithFolder(_ folderPath: String) -> String {
return NSString(string: folderPath).appendingPathComponent(accountDataFileName)
}
public func accountWithID(_ accountID: String) -> Account? {
public func account(with accountID: String) -> Account? {
// Shortcut.
return AccountManager.sharedInstance.existingAccountWithID(accountID)
return AccountManager.sharedInstance.existingAccount(with: accountID)
}
private struct AccountSpecifier {

View File

@ -13,7 +13,7 @@ public extension Article {
var account: Account? {
get {
return accountWithID(accountID)
return account(with: accountID)
}
}
}

View File

@ -13,7 +13,7 @@ public extension Feed {
var account: Account? {
get {
return accountWithID(accountID)
return account(with: accountID)
}
}
}

View File

@ -16,7 +16,7 @@ public final class Folder: DisplayNameProvider, UnreadCountProvider {
public var account: Account? {
get {
return accountWithID(accountID)
return account(with: accountID)
}
}