fix: Config shows changed when not yet initialized

This commit is contained in:
FalsePattern 2025-04-11 17:32:46 +02:00
parent bd47cb201f
commit a4db054b59
Signed by: falsepattern
GPG key ID: E930CDEC50C50E23
3 changed files with 6 additions and 0 deletions

View file

@ -89,6 +89,8 @@ class ZigToolchainEditor(private val sharedState: ZigProjectConfigurationProvide
} }
override fun isModified(context: Project): Boolean { override fun isModified(context: Project): Boolean {
if (isEmpty)
return false
val uuid = selectedUUID val uuid = selectedUUID
if (ZigToolchainService.getInstance(context).toolchainUUID != selectedUUID) { if (ZigToolchainService.getInstance(context).toolchainUUID != selectedUUID) {
return true return true

View file

@ -82,6 +82,8 @@ abstract class UUIDMapSelector<T>(val driver: UUIDComboBoxDriver<T>): Disposable
} }
} }
protected val isEmpty: Boolean get() = model.isEmpty
protected open fun onSelection(uuid: UUID?) {} protected open fun onSelection(uuid: UUID?) {}
private fun refreshButtonState(item: ListElem<*>) { private fun refreshButtonState(item: ListElem<*>) {

View file

@ -58,6 +58,8 @@ class ZLSEditor<T: ZigToolchain>(private val sharedState: ZigProjectConfiguratio
} }
override fun isModified(toolchain: T): Boolean { override fun isModified(toolchain: T): Boolean {
if (isEmpty)
return false
return toolchain.zlsUUID != selectedUUID return toolchain.zlsUUID != selectedUUID
} }