Move array of sendToCommands from AppDelegate to SharingServicePickerDelegate, where it belongs, since it’s the only place where it’s used.
This commit is contained in:
parent
94da6fc7de
commit
9a1ccc4296
|
@ -31,10 +31,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
||||||
@IBOutlet var sortByNewestArticleOnTopMenuItem: NSMenuItem!
|
@IBOutlet var sortByNewestArticleOnTopMenuItem: NSMenuItem!
|
||||||
@IBOutlet var checkForUpdatesMenuItem: NSMenuItem!
|
@IBOutlet var checkForUpdatesMenuItem: NSMenuItem!
|
||||||
|
|
||||||
lazy var sendToCommands: [SendToCommand] = {
|
|
||||||
return [SendToMicroBlogCommand(), SendToMarsEditCommand()]
|
|
||||||
}()
|
|
||||||
|
|
||||||
var unreadCount = 0 {
|
var unreadCount = 0 {
|
||||||
didSet {
|
didSet {
|
||||||
if unreadCount != oldValue {
|
if unreadCount != oldValue {
|
||||||
|
|
|
@ -26,9 +26,13 @@ import AppKit
|
||||||
return sharingServiceDelegate
|
return sharingServiceDelegate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static let sendToCommands: [SendToCommand] = {
|
||||||
|
return [SendToMicroBlogCommand(), SendToMarsEditCommand()]
|
||||||
|
}()
|
||||||
|
|
||||||
static func customSharingServices(for items: [Any]) -> [NSSharingService] {
|
static func customSharingServices(for items: [Any]) -> [NSSharingService] {
|
||||||
|
|
||||||
let customServices = appDelegate.sendToCommands.compactMap { (sendToCommand) -> NSSharingService? in
|
let customServices = sendToCommands.compactMap { (sendToCommand) -> NSSharingService? in
|
||||||
|
|
||||||
guard let object = items.first else {
|
guard let object = items.first else {
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue