From 527e6779346c998520543f731e5f4a3bb9c9ebff Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 29 May 2019 20:53:00 -0500 Subject: [PATCH] Rename deleteFolder to removeFolder to make the API more consistent --- Frameworks/Account/Account.swift | 6 +++--- Frameworks/Account/AccountDelegate.swift | 2 +- Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift | 8 ++++---- .../Account/LocalAccount/LocalAccountDelegate.swift | 4 ++-- Mac/Scriptability/Account+Scriptability.swift | 2 +- Shared/Commands/DeleteCommand.swift | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index d1313beb3..bcd4a61ab 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -412,8 +412,8 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, delegate.restoreFeed(for: self, feed: feed, container: container, completion: completion) } - public func deleteFolder(_ folder: Folder, completion: @escaping (Result) -> Void) { - delegate.deleteFolder(for: self, with: folder, completion: completion) + public func removeFolder(_ folder: Folder, completion: @escaping (Result) -> Void) { + delegate.removeFolder(for: self, with: folder, completion: completion) } public func renameFolder(_ folder: Folder, to name: String, completion: @escaping (Result) -> Void) { @@ -680,7 +680,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, } } - func deleteFolder(_ folder: Folder) { + func removeFolder(_ folder: Folder) { folders?.remove(folder) structureDidChange() postChildrenDidChangeNotification() diff --git a/Frameworks/Account/AccountDelegate.swift b/Frameworks/Account/AccountDelegate.swift index 0d92a4f77..01eb15e7f 100644 --- a/Frameworks/Account/AccountDelegate.swift +++ b/Frameworks/Account/AccountDelegate.swift @@ -30,7 +30,7 @@ protocol AccountDelegate { func importOPML(for account:Account, opmlFile: URL, completion: @escaping (Result) -> Void) func renameFolder(for account: Account, with folder: Folder, to name: String, completion: @escaping (Result) -> Void) - func deleteFolder(for account: Account, with folder: Folder, completion: @escaping (Result) -> Void) + func removeFolder(for account: Account, with folder: Folder, completion: @escaping (Result) -> Void) func createFeed(for account: Account, url: String, name: String?, container: Container, completion: @escaping (Result) -> Void) func renameFeed(for account: Account, with feed: Feed, to name: String, completion: @escaping (Result) -> Void) diff --git a/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift b/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift index 58f5b5ebb..621e3093a 100644 --- a/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift @@ -250,11 +250,11 @@ final class FeedbinAccountDelegate: AccountDelegate { } - func deleteFolder(for account: Account, with folder: Folder, completion: @escaping (Result) -> Void) { + func removeFolder(for account: Account, with folder: Folder, completion: @escaping (Result) -> Void) { // Feedbin uses tags and if at least one feed isn't tagged, then the folder doesn't exist on their system guard folder.hasAtLeastOneFeed() else { - account.deleteFolder(folder) + account.removeFolder(folder) return } @@ -270,7 +270,7 @@ final class FeedbinAccountDelegate: AccountDelegate { account.addFeed(feed) self.clearFolderRelationship(for: feed, withFolderName: folder.name ?? "") } - account.deleteFolder(folder) + account.removeFolder(folder) } completion(.success(())) } @@ -570,7 +570,7 @@ private extension FeedbinAccountDelegate { account.addFeed(feed) clearFolderRelationship(for: feed, withFolderName: folder.name ?? "") } - account.deleteFolder(folder) + account.removeFolder(folder) } } } diff --git a/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift b/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift index 8ce2848aa..d1fe5f84e 100644 --- a/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift +++ b/Frameworks/Account/LocalAccount/LocalAccountDelegate.swift @@ -97,8 +97,8 @@ final class LocalAccountDelegate: AccountDelegate { completion(.success(())) } - func deleteFolder(for account: Account, with folder: Folder, completion: @escaping (Result) -> Void) { - account.deleteFolder(folder) + func removeFolder(for account: Account, with folder: Folder, completion: @escaping (Result) -> Void) { + account.removeFolder(folder) completion(.success(())) } diff --git a/Mac/Scriptability/Account+Scriptability.swift b/Mac/Scriptability/Account+Scriptability.swift index f0ce08e22..3647282e3 100644 --- a/Mac/Scriptability/Account+Scriptability.swift +++ b/Mac/Scriptability/Account+Scriptability.swift @@ -50,7 +50,7 @@ class ScriptableAccount: NSObject, UniqueIdScriptingObject, ScriptingObjectConta func deleteElement(_ element:ScriptingObject) { if let scriptableFolder = element as? ScriptableFolder { BatchUpdate.shared.perform { - account.deleteFolder(scriptableFolder.folder) { result in + account.removeFolder(scriptableFolder.folder) { result in } } } else if let scriptableFeed = element as? ScriptableFeed { diff --git a/Shared/Commands/DeleteCommand.swift b/Shared/Commands/DeleteCommand.swift index cc3b5eac9..f35ce5c75 100644 --- a/Shared/Commands/DeleteCommand.swift +++ b/Shared/Commands/DeleteCommand.swift @@ -142,7 +142,7 @@ private struct SidebarItemSpecifier { } } else if let folder = folder { BatchUpdate.shared.start() - account?.deleteFolder(folder) { result in + account?.removeFolder(folder) { result in BatchUpdate.shared.end() self.checkResult(result) }