From 21cf22906bba1a6b3aa217a2d775126d187297d1 Mon Sep 17 00:00:00 2001 From: hstyi Date: Wed, 15 Jan 2025 15:13:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/app/termora/HostTreeDialog.kt | 3 ++- src/main/kotlin/app/termora/WelcomePanel.kt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/termora/HostTreeDialog.kt b/src/main/kotlin/app/termora/HostTreeDialog.kt index b7495ae..46d5be9 100644 --- a/src/main/kotlin/app/termora/HostTreeDialog.kt +++ b/src/main/kotlin/app/termora/HostTreeDialog.kt @@ -36,7 +36,7 @@ class HostTreeDialog( title = I18n.getString("termora.transport.sftp.select-host") tree.setModel(SearchableHostTreeModel(tree.model) { host -> - host.protocol == Protocol.Folder || host.protocol == Protocol.SSH + (host.protocol == Protocol.Folder || host.protocol == Protocol.SSH) && filter.invoke(host) }) tree.contextmenu = true tree.doubleClickConnection = false @@ -73,6 +73,7 @@ class HostTreeDialog( addWindowListener(object : WindowAdapter() { override fun windowClosed(e: WindowEvent) { + tree.setModel(null) Database.getDatabase().properties.putString( "HostTreeDialog.HostTreeExpansionState", TreeUtils.saveExpansionState(tree) diff --git a/src/main/kotlin/app/termora/WelcomePanel.kt b/src/main/kotlin/app/termora/WelcomePanel.kt index 63c7257..67ac711 100644 --- a/src/main/kotlin/app/termora/WelcomePanel.kt +++ b/src/main/kotlin/app/termora/WelcomePanel.kt @@ -229,6 +229,7 @@ class WelcomePanel(private val windowScope: WindowScope) : JPanel(BorderLayout() } override fun dispose() { + hostTree.setModel(null) properties.putString("WelcomeFullContent", fullContent.toString()) }