This commit is contained in:
Brent Simmons
2018-02-02 21:56:52 -08:00
109 changed files with 1895 additions and 1881 deletions

View File

@@ -19,7 +19,7 @@ final class MainWindowKeyboardHandler: KeyboardDelegate {
let f = Bundle.main.path(forResource: "GlobalKeyboardShortcuts", ofType: "plist")!
let rawShortcuts = NSArray(contentsOfFile: f)! as! [[String: Any]]
self.globalShortcuts = Set(rawShortcuts.flatMap { KeyboardShortcut(dictionary: $0) })
self.globalShortcuts = Set(rawShortcuts.compactMap { KeyboardShortcut(dictionary: $0) })
}
func keydown(_ event: NSEvent, in view: NSView) -> Bool {

View File

@@ -113,7 +113,7 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
// MARK: Toolbar
@objc func makeToolbarValidate(_ sender: Any) {
@objc func makeToolbarValidate(_ sender: Any?) {
window?.toolbar?.validateVisibleItems()
}
@@ -332,7 +332,7 @@ extension MainWindowController: NSSharingServicePickerDelegate {
func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, sharingServicesForItems items: [Any], proposedSharingServices proposedServices: [NSSharingService]) -> [NSSharingService] {
let sendToServices = appDelegate.sendToCommands.flatMap { (sendToCommand) -> NSSharingService? in
let sendToServices = appDelegate.sendToCommands.compactMap { (sendToCommand) -> NSSharingService? in
guard let object = items.first else {
return nil

View File

@@ -19,7 +19,7 @@ import RSCore
let f = Bundle.main.path(forResource: "SidebarKeyboardShortcuts", ofType: "plist")!
let rawShortcuts = NSArray(contentsOfFile: f)! as! [[String: Any]]
self.shortcuts = Set(rawShortcuts.flatMap { KeyboardShortcut(dictionary: $0) })
self.shortcuts = Set(rawShortcuts.compactMap { KeyboardShortcut(dictionary: $0) })
super.init()
}

View File

@@ -45,7 +45,7 @@ extension Array where Element == Article {
func articlesForIndexes(_ indexes: IndexSet) -> Set<Article> {
return Set(indexes.flatMap{ (oneIndex) -> Article? in
return Set(indexes.compactMap{ (oneIndex) -> Article? in
return articleAtRow(oneIndex)
})
}

View File

@@ -21,7 +21,7 @@ import RSCore
let f = Bundle.main.path(forResource: "TimelineKeyboardShortcuts", ofType: "plist")!
let rawShortcuts = NSArray(contentsOfFile: f)! as! [[String: Any]]
self.shortcuts = Set(rawShortcuts.flatMap { KeyboardShortcut(dictionary: $0) })
self.shortcuts = Set(rawShortcuts.compactMap { KeyboardShortcut(dictionary: $0) })
super.init()
}