automatically delete obsolete config properties

This commit is contained in:
octarine-noise
2016-09-05 22:45:00 +02:00
parent f0a447bbbb
commit 85a4707494
2 changed files with 16 additions and 0 deletions

View File

@@ -144,6 +144,14 @@ abstract class ConfigPropertyBase {
open fun read() {}
}
class ObsoleteConfigProperty : ConfigPropertyBase() {
override fun attach(target: Configuration, langPrefix: String, categoryName: String, propertyName: String) {
target.getCategory(categoryName)?.remove(propertyName)
}
override val guiProperties = emptyList<Property>()
override val hasChanged: Boolean get() = false
}
/** Delegate for a property backed by a single [Property] instance. */
abstract class ConfigPropertyDelegate<T>() : ConfigPropertyBase() {
/** Cached value of the property. */