chore: folder count (#542)

This commit is contained in:
hstyi
2025-04-28 09:11:07 +08:00
committed by GitHub
parent 1f01e368dd
commit 1736dd909e

View File

@@ -49,7 +49,7 @@ class NewHostTree : SimpleTree() {
private val properties get() = Database.getDatabase().properties private val properties get() = Database.getDatabase().properties
private val owner get() = SwingUtilities.getWindowAncestor(this) private val owner get() = SwingUtilities.getWindowAncestor(this)
private val openHostAction get() = ActionManager.getInstance().getAction(OpenHostAction.OPEN_HOST) private val openHostAction get() = ActionManager.getInstance().getAction(OpenHostAction.OPEN_HOST)
private val sftpAction get() = ActionManager.getInstance().getAction(Actions.SFTP) private val sftpAction get() = ActionManager.getInstance().getAction(app.termora.Actions.SFTP)
private var isShowMoreInfo private var isShowMoreInfo
get() = properties.getString("HostTree.showMoreInfo", "false").toBoolean() get() = properties.getString("HostTree.showMoreInfo", "false").toBoolean()
set(value) = properties.putString("HostTree.showMoreInfo", value.toString()) set(value) = properties.putString("HostTree.showMoreInfo", value.toString())
@@ -117,7 +117,7 @@ class NewHostTree : SimpleTree() {
} else if (host.protocol == Protocol.Serial) { } else if (host.protocol == Protocol.Serial) {
text = "<html>${host.name}&nbsp;&nbsp;&nbsp;&nbsp;${fontTag.apply(host.options.serialComm.port)}</html>" text = "<html>${host.name}&nbsp;&nbsp;&nbsp;&nbsp;${fontTag.apply(host.options.serialComm.port)}</html>"
} else if (host.protocol == Protocol.Folder) { } else if (host.protocol == Protocol.Folder) {
text = "<html>${host.name}${fontTag.apply(" (${node.childCount})")}</html>" text = "<html>${host.name}${fontTag.apply(" (${node.getAllChildren().size})")}</html>"
} }
// @formatter:on // @formatter:on
} }
@@ -812,7 +812,7 @@ class NewHostTree : SimpleTree() {
var group = bookmarkGroups.find { it.bookmarkIds.contains(id) } var group = bookmarkGroups.find { it.bookmarkIds.contains(id) }
while (group != null && group.id != "default") { while (group != null && group.id != "default") {
folderNames.addFirst(group.title) folderNames.addFirst(group.title)
group = bookmarkGroups.find { it.bookmarkGroupIds.contains(group.id) } group = bookmarkGroups.find { it.bookmarkGroupIds.contains(group?.id ?: StringUtils.EMPTY) }
} }
printer.printRecord( printer.printRecord(