refactor(custom-branding): use getValue operator for options

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
oSumAtrIX
2022-09-17 04:26:29 +02:00
parent 2f1fef0449
commit b2bca0167a

View File

@@ -67,7 +67,7 @@ class CustomBrandingPatch : ResourcePatch() {
} }
private fun getIconStream(iconPath: String): InputStream? { private fun getIconStream(iconPath: String): InputStream? {
val path = Path.of(appIconPath.value ?: return this.javaClass.classLoader.getResourceAsStream(iconPath)) val path = Path.of(appIconPath ?: return this.javaClass.classLoader.getResourceAsStream(iconPath))
return if (path.exists()) return if (path.exists())
path.inputStream() path.inputStream()
@@ -76,7 +76,7 @@ class CustomBrandingPatch : ResourcePatch() {
} }
companion object : OptionsContainer() { companion object : OptionsContainer() {
private var appName = option( private var appName: String? by option(
PatchOption.StringOption( PatchOption.StringOption(
key = "appName", key = "appName",
title = "Application Name", title = "Application Name",
@@ -86,7 +86,7 @@ class CustomBrandingPatch : ResourcePatch() {
) )
) )
private var appIconPath = option( private var appIconPath: String? by option(
PatchOption.StringOption( PatchOption.StringOption(
key = "appIconPath", key = "appIconPath",
title = "Application Icon Path", title = "Application Icon Path",