Delete some dead code.

This commit is contained in:
Brent Simmons 2018-09-16 13:08:44 -07:00
parent 3d45231494
commit 6b6d393b3d
3 changed files with 0 additions and 90 deletions

View File

@ -49,7 +49,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
public let type: AccountType public let type: AccountType
public var nameForDisplay = "" public var nameForDisplay = ""
public var children = [AnyObject]() public var children = [AnyObject]()
// var urlToFeedDictionary = [String: Feed]()
var idToFeedDictionary = [String: Feed]() var idToFeedDictionary = [String: Feed]()
let settingsFile: String let settingsFile: String
let dataFolder: String let dataFolder: String
@ -240,7 +239,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
// If it already existed in that folder, return true. // If it already existed in that folder, return true.
var didAddFeed = false var didAddFeed = false
// let uniquedFeed = existingFeed(with: feed.feedID) ?? feed
if let folder = folder { if let folder = folder {
didAddFeed = folder.addFeed(feed) didAddFeed = folder.addFeed(feed)
@ -633,41 +631,10 @@ private extension Account {
importOPML(parsedOPML) importOPML(parsedOPML)
} }
// func diskDictionary() -> NSDictionary {
//
// let diskObjects = children.compactMap { (object) -> [String: Any]? in
//
// if let folder = object as? Folder {
// return folder.dictionary
// }
// else if let feed = object as? Feed {
// return feed.dictionary
// }
// return nil
// }
//
// var d = [String: Any]()
// d[Key.children] = diskObjects as NSArray
//
// if let userInfo = delegate.userInfo(for: self) {
// d[Key.userInfo] = userInfo
// }
//
// return d as NSDictionary
// }
func saveToDisk() { func saveToDisk() {
dirty = false dirty = false
// let d = diskDictionary()
// do {
// try RSPlist.write(d, filePath: settingsFile)
// }
// catch let error as NSError {
// NSApplication.shared.presentError(error)
// }
let opmlDocumentString = opmlDocument() let opmlDocumentString = opmlDocument()
do { do {
let url = URL(fileURLWithPath: opmlFilePath) let url = URL(fileURLWithPath: opmlFilePath)
@ -693,13 +660,11 @@ private extension Account {
idDictionary[feed.feedID] = feed idDictionary[feed.feedID] = feed
} }
// urlToFeedDictionary = urlDictionary
idToFeedDictionary = idDictionary idToFeedDictionary = idDictionary
} }
func addToFeedDictionaries(_ feed: Feed) { func addToFeedDictionaries(_ feed: Feed) {
// urlToFeedDictionary[feed.url] = feed
idToFeedDictionary[feed.feedID] = feed idToFeedDictionary[feed.feedID] = feed
} }
@ -795,11 +760,6 @@ private extension Account {
extension Account { extension Account {
// public func existingFeed(withURL url: String) -> Feed? {
//
// return urlToFeedDictionary[url]
// }
public func existingFeed(with feedID: String) -> Feed? { public func existingFeed(with feedID: String) -> Feed? {
return idToFeedDictionary[feedID] return idToFeedDictionary[feedID]

View File

@ -188,26 +188,6 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable {
return d[Key.url] != nil return d[Key.url] != nil
} }
// public var dictionary: [String: Any] {
// var d = [String: Any]()
//
// d[Key.url] = url
//
// // feedID is not repeated when its the same as url
// if (feedID != url) {
// d[Key.feedID] = feedID
// }
//
// if let name = name {
// d[Key.name] = name
// }
// if let editedName = editedName {
// d[Key.editedName] = editedName
// }
//
// return d
// }
// MARK: - Debug // MARK: - Debug
public func debugDropConditionalGetInfo() { public func debugDropConditionalGetInfo() {

View File

@ -73,36 +73,6 @@ public final class Folder: DisplayNameProvider, Container, UnreadCountProvider,
} }
} }
// var dictionary: [String: Any] {
//
// var d = [String: Any]()
// guard let account = account else {
// return d
// }
//
// if let name = name {
// d[Key.name] = name
// }
//
// let childObjects = children.compactMap { (child) -> [String: Any]? in
//
// if let feed = child as? Feed {
// return feed.dictionary
// }
// if let folder = child as? Folder, account.supportsSubFolders {
// return folder.dictionary
// }
// assertionFailure("Expected a feed or a folder.");
// return nil
// }
//
// if !childObjects.isEmpty {
// d[Key.children] = childObjects
// }
//
// return d
// }
// MARK: Feeds // MARK: Feeds
func addFeed(_ feed: Feed) -> Bool { func addFeed(_ feed: Feed) -> Bool {