Skip to content

Commit

Permalink
Less settings form logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio-petricca committed Sep 28, 2024
1 parent 78ec7d3 commit dbb2568
Showing 1 changed file with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,18 @@ internal class SettingsConfigurable(private val project: Project) : Configurable
}

override fun isModified(): Boolean {
log.debug("Checking if settings are modified...")
val state = getState()

val settings = SettingsStorage
.getInstance(project)
.state

return settingsForm?.isModified(settings) ?: false
return settingsForm?.isModified(state) ?: false
}

override fun apply() {
log.info("Applying settings...")

val settings = SettingsStorage
.getInstance(project)
.state
val state = getState()

settingsForm?.apply {
settings.templatesPath = (getTemplatesPath() ?: "")
state.templatesPath = (getTemplatesPath() ?: "")
}

ApiHelpers.invokeLater(
Expand All @@ -66,18 +60,18 @@ internal class SettingsConfigurable(private val project: Project) : Configurable
}

override fun getDisplayName(): String {
log.debug("Getting display name...")

return Bundle.message("mt4ij.settings.name")
}

override fun reset() {
log.info("Resetting settings...")
val state = getState()

settingsForm?.setTemplatesPath(state.templatesPath)
}

val settings = SettingsStorage
private fun getState(): SettingsState {
return SettingsStorage
.getInstance(project)
.state

settingsForm?.setTemplatesPath(settings.templatesPath)
}
}

0 comments on commit dbb2568

Please sign in to comment.