Remove unused extension.

This commit is contained in:
Brent Simmons 2018-12-27 22:18:39 -08:00
parent 7cb218b37f
commit 9c13950815
1 changed files with 0 additions and 17 deletions

View File

@ -10,12 +10,6 @@ import AppKit
import Articles import Articles
import RSCore import RSCore
extension Article: PasteboardWriterOwner {
public var pasteboardWriter: NSPasteboardWriting {
return ArticlePasteboardWriter(article: self)
}
}
@objc final class ArticlePasteboardWriter: NSObject, NSPasteboardWriting { @objc final class ArticlePasteboardWriter: NSObject, NSPasteboardWriting {
@ -31,14 +25,12 @@ extension Article: PasteboardWriterOwner {
}() }()
init(article: Article) { init(article: Article) {
self.article = article self.article = article
} }
// MARK: - NSPasteboardWriting // MARK: - NSPasteboardWriting
func writableTypes(for pasteboard: NSPasteboard) -> [NSPasteboard.PasteboardType] { func writableTypes(for pasteboard: NSPasteboard) -> [NSPasteboard.PasteboardType] {
var types = [ArticlePasteboardWriter.articleUTIType] var types = [ArticlePasteboardWriter.articleUTIType]
if let link = article.preferredLink, let _ = URL(string: link) { if let link = article.preferredLink, let _ = URL(string: link) {
@ -50,7 +42,6 @@ extension Article: PasteboardWriterOwner {
} }
func pasteboardPropertyList(forType type: NSPasteboard.PasteboardType) -> Any? { func pasteboardPropertyList(forType type: NSPasteboard.PasteboardType) -> Any? {
let plist: Any? let plist: Any?
switch type { switch type {
@ -75,7 +66,6 @@ extension Article: PasteboardWriterOwner {
private extension ArticlePasteboardWriter { private extension ArticlePasteboardWriter {
func plainText() -> String { func plainText() -> String {
var s = "" var s = ""
if let title = article.title { if let title = article.title {
@ -113,7 +103,6 @@ private extension ArticlePasteboardWriter {
} }
private struct Key { private struct Key {
static let articleID = "articleID" // database ID, unique per account static let articleID = "articleID" // database ID, unique per account
static let uniqueID = "uniqueID" // unique ID, unique per feed (guid, or possibly calculated) static let uniqueID = "uniqueID" // unique ID, unique per feed (guid, or possibly calculated)
static let feedURL = "feedURL" static let feedURL = "feedURL"
@ -153,7 +142,6 @@ private extension ArticlePasteboardWriter {
} }
func exportDictionary() -> [String: Any] { func exportDictionary() -> [String: Any] {
var d = [String: Any]() var d = [String: Any]()
d[Key.articleID] = article.articleID d[Key.articleID] = article.articleID
@ -182,14 +170,12 @@ private extension ArticlePasteboardWriter {
} }
func internalDictionary() -> [String: Any] { func internalDictionary() -> [String: Any] {
var d = exportDictionary() var d = exportDictionary()
d[Key.accountID] = article.accountID d[Key.accountID] = article.accountID
return d return d
} }
func authorDictionary(_ author: Author) -> [String: Any] { func authorDictionary(_ author: Author) -> [String: Any] {
var d = [String: Any]() var d = [String: Any]()
d[Key.authorName] = author.name ?? nil d[Key.authorName] = author.name ?? nil
@ -202,7 +188,6 @@ private extension ArticlePasteboardWriter {
} }
func attachmentDictionary(_ attachment: Attachment) -> [String: Any] { func attachmentDictionary(_ attachment: Attachment) -> [String: Any] {
var d = [String: Any]() var d = [String: Any]()
d[Key.attachmentURL] = attachment.url d[Key.attachmentURL] = attachment.url
@ -215,7 +200,6 @@ private extension ArticlePasteboardWriter {
} }
func authorDictionaries() -> [[String: Any]]? { func authorDictionaries() -> [[String: Any]]? {
guard let authors = article.authors, !authors.isEmpty else { guard let authors = article.authors, !authors.isEmpty else {
return nil return nil
} }
@ -223,7 +207,6 @@ private extension ArticlePasteboardWriter {
} }
func attachmentDictionaries() -> [[String: Any]]? { func attachmentDictionaries() -> [[String: Any]]? {
guard let attachments = article.attachments, !attachments.isEmpty else { guard let attachments = article.attachments, !attachments.isEmpty else {
return nil return nil
} }