diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index d6845f83d..3b85c49a7 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -63,7 +63,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, private var fetchingAllUnreadCounts = false - let settingsFile: String let dataFolder: String let database: ArticlesDatabase let delegate: AccountDelegate @@ -126,7 +125,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, return delegate.supportsSubFolders } - init?(dataFolder: String, settingsFile: String, type: AccountType, accountID: String) { + init?(dataFolder: String, type: AccountType, accountID: String) { // TODO: support various syncing systems. precondition(type == .onMyMac) @@ -134,7 +133,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, self.accountID = accountID self.type = type - self.settingsFile = settingsFile self.dataFolder = dataFolder self.opmlFilePath = (dataFolder as NSString).appendingPathComponent("Subscriptions.opml") @@ -635,46 +633,6 @@ private extension Account { } func pullObjectsFromDisk() { - - // 9/16/2018: Turning a corner — we used to store data in a plist file, - // but now we’re switching over to OPML. Read the plist file one last time, - // then rename it so we never read from it again. - - if FileManager.default.fileExists(atPath: settingsFile) { - // Old code for reading in plist file. - let settingsFileURL = URL(fileURLWithPath: settingsFile) - guard let d = NSDictionary(contentsOf: settingsFileURL) as? [String: Any] else { - return - } - guard let childrenArray = d[Key.children] as? [[String: Any]] else { - return - } - let children = objects(with: childrenArray) - var feeds = Set() - var folders = Set() - for oneChild in children { - if let feed = oneChild as? Feed { - feeds.insert(feed) - } - else if let folder = oneChild as? Folder { - folders.insert(folder) - } - } - self.topLevelFeeds = feeds - self.folders = folders - structureDidChange() - - // Rename plist file so we don’t see it next time. - let renamedFilePath = (dataFolder as NSString).appendingPathComponent("AccountData-old.plist") - do { - try FileManager.default.moveItem(atPath: settingsFile, toPath: renamedFilePath) - } - catch {} - - dirty = true // Ensure OPML file will be written soon. - return - } - importFeedMetadata() importOPMLFile(path: opmlFilePath) } diff --git a/Frameworks/Account/AccountManager.swift b/Frameworks/Account/AccountManager.swift index 7fd66d1db..3af54eca8 100644 --- a/Frameworks/Account/AccountManager.swift +++ b/Frameworks/Account/AccountManager.swift @@ -65,8 +65,7 @@ public final class AccountManager: UnreadCountProvider { abort() } - let localAccountSettingsFile = accountFilePathWithFolder(localAccountFolder) - localAccount = Account(dataFolder: localAccountFolder, settingsFile: localAccountSettingsFile, type: .onMyMac, accountID: localAccountIdentifier)! + localAccount = Account(dataFolder: localAccountFolder, type: .onMyMac, accountID: localAccountIdentifier)! accountsDictionary[localAccount.accountID] = localAccount readNonLocalAccountsFromDisk()