Merge pull request #2050 from jbennett/2049-add-folder-management-behavior

Adds an account behavior to disable folders
This commit is contained in:
Maurice Parker 2020-05-08 15:36:16 -05:00 committed by GitHub
commit 50e6e8e190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions

View File

@ -28,6 +28,11 @@ public enum AccountBehavior: Equatable {
*/
case disallowFeedInRootFolder
/**
Account doesn't support folders
*/
case disallowFolderManagement
/**
Account doesn't support OPML imports
*/

View File

@ -16,7 +16,7 @@ import Secrets
final class FeedWranglerAccountDelegate: AccountDelegate {
var behaviors: AccountBehaviors = []
var behaviors: AccountBehaviors = [.disallowFolderManagement]
var isOPMLImportInProgress = false
var server: String? = FeedWranglerConfig.clientPath

View File

@ -42,7 +42,11 @@ class AddFolderWindowController : NSWindowController {
let menu = NSMenu()
accountPopupButton.menu = menu
for oneAccount in AccountManager.shared.sortedActiveAccounts {
let accounts = AccountManager.shared
.sortedActiveAccounts
.filter { !$0.behaviors.contains(.disallowFolderManagement) }
for oneAccount in accounts {
let oneMenuItem = NSMenuItem()
oneMenuItem.title = oneAccount.nameForDisplay

View File

@ -43,7 +43,9 @@ class AddFolderViewController: UITableViewController, AddContainerViewController
super.viewDidLoad()
accounts = AccountManager.shared.sortedActiveAccounts
accounts = AccountManager.shared
.sortedActiveAccounts
.filter { !$0.behaviors.contains(.disallowFolderManagement) }
nameTextField.delegate = self