Profile: Use file based features
This commit is contained in:
parent
91c816ca96
commit
72bfe2c784
@ -16,6 +16,10 @@ import java.io.File
|
||||
*/
|
||||
class ProfileComponent : ConfigFileBasedComponent<NeoProfile>() {
|
||||
override fun onCheckComponentFiles() {
|
||||
val profileDir = File(NeoTermPath.PROFILE_PATH)
|
||||
if (!profileDir.exists()) {
|
||||
profileDir.mkdirs()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateComponentObject(configVisitor: ConfigVisitor): NeoProfile {
|
||||
@ -42,22 +46,4 @@ class ProfileComponent : ConfigFileBasedComponent<NeoProfile>() {
|
||||
fun unregisterProfile(metaName: String) {
|
||||
profileRegistry.remove(metaName)
|
||||
}
|
||||
|
||||
override fun onServiceInit() {
|
||||
checkForFiles()
|
||||
}
|
||||
|
||||
override fun onServiceDestroy() {
|
||||
}
|
||||
|
||||
override fun onServiceObtained() {
|
||||
checkForFiles()
|
||||
}
|
||||
|
||||
private fun checkForFiles() {
|
||||
val profileDir = File(NeoTermPath.PROFILE_PATH)
|
||||
if (!profileDir.exists()) {
|
||||
profileDir.mkdirs()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user