Fix lint issues.

This commit is contained in:
Brent Simmons
2025-01-22 22:17:02 -08:00
parent 8f1379360c
commit 40ada2ba5a
91 changed files with 1278 additions and 1350 deletions

View File

@@ -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)
}
}
}
}
}