Continue working on build errors.

This commit is contained in:
Brent Simmons 2017-09-17 12:34:10 -07:00
parent 0ce18fe11a
commit 1b391c262e
17 changed files with 76 additions and 39 deletions

View File

@ -145,7 +145,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations {
rs_performSelectorCoalesced(#selector(updateBadge), with: nil, afterDelay: 0.01)
}
dynamic func updateBadge() {
@objc dynamic func updateBadge() {
let label = unreadCount > 0 ? "\(unreadCount)" : ""
NSApplication.shared().dockTile.badgeLabel = label

View File

@ -66,12 +66,12 @@ public final class ArticleStylesManager {
updateStyleNames()
updateCurrentStyle()
NotificationCenter.default.addObserver(self, selector: #selector(applicationDidBecomeActive(_:)), name: NSNotification.Name.NSApplicationDidBecomeActive, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(applicationDidBecomeActive(_:)), name: NSNotification.Name.NSApplication.didBecomeActiveNotification, object: nil)
}
// MARK: Notifications
dynamic func applicationDidBecomeActive(_ note: Notification) {
@objc dynamic func applicationDidBecomeActive(_ note: Notification) {
updateStyleNames()
updateCurrentStyle()

View File

@ -8,6 +8,7 @@
import Foundation
import Data
import Account
// These handle multiple accounts.
@ -34,7 +35,7 @@ private func accountAndArticlesDictionary(_ articles: NSSet) -> [String: NSSet]
guard let oneArticle = oneObject as? Article else {
return
}
guard let oneAccountIdentifier = oneArticle.account?.identifier else {
guard let oneAccountIdentifier = oneArticle.account?.accountID else {
return
}
@ -46,9 +47,9 @@ private func accountAndArticlesDictionary(_ articles: NSSet) -> [String: NSSet]
return d
}
private func accountWithIdentifier(_ identifier: String) -> Account? {
private func accountWithID(_ accountID: String) -> Account? {
return AccountManager.sharedInstance.existingAccountWithIdentifier(identifier)
return AccountManager.sharedInstance.existingAccountWithIdentifier(accountID)
}
func preferredLink(for article: Article) -> String? {

View File

@ -8,7 +8,7 @@
import Foundation
import Data
import LocalAccount
import Account
private func shouldImportDefaultFeeds(_ isFirstRun: Bool) -> Bool {

View File

@ -11,6 +11,7 @@ import RSCore
import RSTree
import Data
import RSFeedFinder
import Account
// Run add-feed sheet.
// If it returns with URL and optional name,

View File

@ -10,6 +10,7 @@ import Cocoa
import RSCore
import RSTree
import Data
import Account
protocol AddFeedWindowControllerDelegate: class {
@ -46,7 +47,7 @@ class AddFeedWindowController : NSWindowController {
convenience init(urlString: String?, name: String?, folderTreeController: TreeController, delegate: AddFeedWindowControllerDelegate?) {
self.init(windowNibName: "AddFeedSheet")
self.init(windowNibName: NSNib.Name(rawValue: "AddFeedSheet"))
self.urlString = urlString
self.initialName = name
self.delegate = delegate
@ -56,7 +57,7 @@ class AddFeedWindowController : NSWindowController {
func runSheetOnWindow(_ w: NSWindow) {
hostWindow = w
hostWindow.beginSheet(window!) { (returnCode: NSModalResponse) -> Void in
hostWindow.beginSheet(window!) { (returnCode: NSApplication.ModalResponse) -> Void in
}
}
@ -110,7 +111,7 @@ class AddFeedWindowController : NSWindowController {
@IBAction func localShowFeedList(_ sender: AnyObject) {
NSApplication.shared().sendAction(NSSelectorFromString("showFeedList:"), to: nil, from: sender)
NSApplication.shared.sendAction(NSSelectorFromString("showFeedList:"), to: nil, from: sender)
hostWindow.endSheet(window!, returnCode: NSModalResponseContinue)
}

View File

@ -9,6 +9,7 @@
import Cocoa
import RSTree
import Data
import Account
@objc class SidebarViewController: NSViewController, NSOutlineViewDelegate, NSOutlineViewDataSource {
@ -32,7 +33,7 @@ import Data
//MARK: Notifications
dynamic func unreadCountDidChange(_ note: Notification) {
@objc dynamic func unreadCountDidChange(_ note: Notification) {
guard let representedObject = note.object else {
return
@ -40,17 +41,17 @@ import Data
let _ = configureCellsForRepresentedObject(representedObject as AnyObject)
}
dynamic func folderChildrenDidChange(_ note: Notification) {
@objc dynamic func folderChildrenDidChange(_ note: Notification) {
rebuildTreeAndReloadDataIfNeeded()
}
dynamic func dataModelDidPerformBatchUpdates(_ notification: Notification) {
@objc dynamic func dataModelDidPerformBatchUpdates(_ notification: Notification) {
rebuildTreeAndReloadDataIfNeeded()
}
dynamic func userDidAddFeed(_ note: Notification) {
@objc dynamic func userDidAddFeed(_ note: Notification) {
// Find the feed and select it.

View File

@ -43,7 +43,7 @@ final class StatusBarView: NSView {
// MARK: Notifications
dynamic func progressDidChange(_ notification: Notification) {
@objc dynamic func progressDidChange(_ notification: Notification) {
guard let progress = notification.userInfo?[progressKey] as? DownloadProgress else {
return
@ -54,7 +54,7 @@ final class StatusBarView: NSView {
// MARK: Notifications
dynamic func timelineSelectionDidChange(_ note: Notification) {
@objc dynamic func timelineSelectionDidChange(_ note: Notification) {
let timelineView = note.userInfo?[viewKey] as! NSView

View File

@ -11,7 +11,7 @@ import DB5
struct TimelineCellAppearance {
let cellPadding: EdgeInsets
let cellPadding: NSEdgeInsets
let feedNameColor: NSColor
let feedNameFont: NSFont

View File

@ -11,7 +11,7 @@ import RSCore
import RSTextDrawing
import RSTree
import Data
import LocalAccount
import Account
let timelineFontSizeKVOKey = "values." + TimelineFontSizeKey

View File

@ -12,7 +12,7 @@ class IndeterminateProgressWindowController: NSWindowController {
@IBOutlet var messageLabel: NSTextField!
@IBOutlet var progressIndicator: NSProgressIndicator!
dynamic var message = ""
@objc dynamic var message = ""
convenience init(message: String) {

View File

@ -19,8 +19,9 @@
846E77451F6EF9B900A165E2 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8419740D1F6DD25F006346C4 /* Container.swift */; };
846E774F1F6EF9C000A165E2 /* LocalAccountDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8419742C1F6DDE84006346C4 /* LocalAccountDelegate.swift */; };
846E77501F6EF9C400A165E2 /* LocalAccountRefresher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8419742D1F6DDE96006346C4 /* LocalAccountRefresher.swift */; };
846E77521F6EFDFB00A165E2 /* Feed+Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846E77511F6EFDFB00A165E2 /* Feed+Account.swift */; };
846E77541F6F00E300A165E2 /* AccountManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846E77531F6F00E300A165E2 /* AccountManager.swift */; };
846E77571F6F03D600A165E2 /* Article+Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846E77561F6F03D600A165E2 /* Article+Account.swift */; };
846E77591F6F03E300A165E2 /* Feed+Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846E77581F6F03E300A165E2 /* Feed+Account.swift */; };
848935001F62484F00CEBD24 /* Account.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 848934F61F62484F00CEBD24 /* Account.framework */; };
848935051F62485000CEBD24 /* AccountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848935041F62485000CEBD24 /* AccountTests.swift */; };
/* End PBXBuildFile section */
@ -110,8 +111,9 @@
841974241F6DDCE4006346C4 /* AccountDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountDelegate.swift; sourceTree = "<group>"; };
8419742C1F6DDE84006346C4 /* LocalAccountDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalAccountDelegate.swift; sourceTree = "<group>"; };
8419742D1F6DDE96006346C4 /* LocalAccountRefresher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalAccountRefresher.swift; sourceTree = "<group>"; };
846E77511F6EFDFB00A165E2 /* Feed+Account.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Feed+Account.swift"; sourceTree = "<group>"; };
846E77531F6F00E300A165E2 /* AccountManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountManager.swift; sourceTree = "<group>"; };
846E77561F6F03D600A165E2 /* Article+Account.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "Article+Account.swift"; path = "Extensions/Article+Account.swift"; sourceTree = "<group>"; };
846E77581F6F03E300A165E2 /* Feed+Account.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "Feed+Account.swift"; path = "Extensions/Feed+Account.swift"; sourceTree = "<group>"; };
848934F61F62484F00CEBD24 /* Account.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Account.framework; sourceTree = BUILT_PRODUCTS_DIR; };
848934FA1F62484F00CEBD24 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
848934FF1F62484F00CEBD24 /* AccountTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AccountTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@ -210,6 +212,15 @@
name = Frameworks;
sourceTree = "<group>";
};
846E77551F6F03B200A165E2 /* Extensions */ = {
isa = PBXGroup;
children = (
846E77581F6F03E300A165E2 /* Feed+Account.swift */,
846E77561F6F03D600A165E2 /* Article+Account.swift */,
);
name = Extensions;
sourceTree = "<group>";
};
848934EC1F62484F00CEBD24 = {
isa = PBXGroup;
children = (
@ -217,7 +228,7 @@
848935101F62486800CEBD24 /* Account.swift */,
841974241F6DDCE4006346C4 /* AccountDelegate.swift */,
841974001F6DD1EC006346C4 /* Folder.swift */,
846E77511F6EFDFB00A165E2 /* Feed+Account.swift */,
846E77551F6F03B200A165E2 /* Extensions */,
841974141F6DD4FF006346C4 /* Container */,
8419742B1F6DDE84006346C4 /* Local */,
8469F80F1F6DC3C10084783E /* Frameworks */,
@ -439,7 +450,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
846E77521F6EFDFB00A165E2 /* Feed+Account.swift in Sources */,
846E77571F6F03D600A165E2 /* Article+Account.swift in Sources */,
8469F81C1F6DD15E0084783E /* Account.swift in Sources */,
846E77451F6EF9B900A165E2 /* Container.swift in Sources */,
8419741A1F6DD583006346C4 /* Account+Container.swift in Sources */,
@ -447,6 +458,7 @@
846E77541F6F00E300A165E2 /* AccountManager.swift in Sources */,
846E77501F6EF9C400A165E2 /* LocalAccountRefresher.swift in Sources */,
841974011F6DD1EC006346C4 /* Folder.swift in Sources */,
846E77591F6F03E300A165E2 /* Feed+Account.swift in Sources */,
846E774F1F6EF9C000A165E2 /* LocalAccountDelegate.swift in Sources */,
841974181F6DD535006346C4 /* Folder+Container.swift in Sources */,
);

View File

@ -15,14 +15,14 @@ let AccountsDidChangeNotification = "AccountsDidChangeNotification"
private let localAccountFolderName = "OnMyMac"
private let localAccountIdentifier = "OnMyMac"
final class AccountManager: UnreadCountProvider {
public final class AccountManager: UnreadCountProvider {
static let sharedInstance = AccountManager()
public static let sharedInstance = AccountManager()
public let localAccount: Account
private let accountsFolder = RSDataSubfolder(nil, "Accounts")!
private var accountsDictionary = [String: Account]()
let localAccount: Account
var unreadCount = 0 {
public var unreadCount = 0 {
didSet {
postUnreadCountDidChangeNotification()
}
@ -40,7 +40,7 @@ final class AccountManager: UnreadCountProvider {
}
}
var refreshInProgress: Bool {
public var refreshInProgress: Bool {
get {
for oneAccount in accountsDictionary.values {
if oneAccount.refreshInProgress {
@ -51,7 +51,7 @@ final class AccountManager: UnreadCountProvider {
}
}
init() {
public init() {
// The local "On My Mac" account must always exist, even if it's empty.
@ -75,12 +75,12 @@ final class AccountManager: UnreadCountProvider {
// MARK: API
func existingAccountWithID(_ accountID: String) -> Account? {
public func existingAccountWithID(_ accountID: String) -> Account? {
return accountsDictionary[accountID]
}
func refreshAll() {
public func refreshAll() {
accounts.forEach { (account) in
account.refreshAll()
@ -108,8 +108,6 @@ final class AccountManager: UnreadCountProvider {
return false
}
// MARK: UnreadCountProvider
func updateUnreadCount() {
let updatedUnreadCount = calculateUnreadCount(accounts)

View File

@ -0,0 +1,20 @@
//
// Article+Account.swift
// Account
//
// Created by Brent Simmons on 9/17/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
//
import Foundation
import Data
public extension Article {
var account: Account? {
get {
return AccountManager.sharedInstance.existingAccountWithID(accountID)
}
}
}

View File

@ -308,6 +308,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
@ -351,6 +352,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";

View File

@ -6,15 +6,16 @@
</editor> -->
<title>ToDo</title>
<dateCreated>Tue, 12 Sep 2017 20:15:17 GMT</dateCreated>
<expansionState>11,16,17,20,24,29,31,34,37,39,40,42,46,49,51,53,55,64,69</expansionState>
<vertScrollState>52</vertScrollState>
<windowTop>3298</windowTop>
<windowLeft>544</windowLeft>
<windowRight>1276</windowRight>
<windowBottom>4057</windowBottom>
<expansionState>0,18,21,25,30,40,41,43,47,50,52,54,56,65,70</expansionState>
<vertScrollState>0</vertScrollState>
<windowTop>452</windowTop>
<windowLeft>543</windowLeft>
<windowRight>1275</windowRight>
<windowBottom>1211</windowBottom>
</head>
<body>
<outline text="App">
<outline text="Get it building again"/>
<outline text="Require High Sierra"/>
<outline text="Use new app icon"/>
<outline text="Set -NSApplicationCrashOnExceptions YES"/>