mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix lint issues.
This commit is contained in:
@@ -14,34 +14,34 @@ import Account
|
||||
class FolderTreeMenu {
|
||||
|
||||
static func createFolderPopupMenu(with rootNode: Node, restrictToSpecialAccounts: Bool = false) -> NSMenu {
|
||||
|
||||
|
||||
let menu = NSMenu(title: "Folders")
|
||||
menu.autoenablesItems = false
|
||||
|
||||
|
||||
for childNode in rootNode.childNodes {
|
||||
|
||||
|
||||
guard let account = childNode.representedObject as? Account else {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
if restrictToSpecialAccounts && !(account.type == .onMyMac || account.type == .cloudKit) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
let menuItem = NSMenuItem(title: account.nameForDisplay, action: nil, keyEquivalent: "")
|
||||
menuItem.representedObject = childNode.representedObject
|
||||
|
||||
|
||||
if account.behaviors.contains(.disallowFeedInRootFolder) {
|
||||
menuItem.isEnabled = false
|
||||
}
|
||||
|
||||
|
||||
menu.addItem(menuItem)
|
||||
|
||||
let childNodes = childNode.childNodes
|
||||
addFolderItemsToMenuWithNodes(menu: menu, nodes: childNodes, indentationLevel: 1)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return menu
|
||||
}
|
||||
|
||||
@@ -61,21 +61,21 @@ class FolderTreeMenu {
|
||||
}
|
||||
|
||||
private static func addFolderItemsToMenuWithNodes(menu: NSMenu, nodes: [Node], indentationLevel: Int) {
|
||||
|
||||
|
||||
for oneNode in nodes {
|
||||
|
||||
if let nameProvider = oneNode.representedObject as? DisplayNameProvider {
|
||||
|
||||
|
||||
let menuItem = NSMenuItem(title: nameProvider.nameForDisplay, action: nil, keyEquivalent: "")
|
||||
menuItem.indentationLevel = indentationLevel
|
||||
menuItem.representedObject = oneNode.representedObject
|
||||
menu.addItem(menuItem)
|
||||
|
||||
|
||||
if oneNode.numberOfChildNodes > 0 {
|
||||
addFolderItemsToMenuWithNodes(menu: menu, nodes: oneNode.childNodes, indentationLevel: indentationLevel + 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user