got rid of TODO comments that are no longer needed, different implementation was used

This commit is contained in:
NightlyFox 2018-09-19 15:29:06 -05:00
parent 2f887cc3e8
commit bd239326b0

View File

@ -76,37 +76,20 @@ void themeStartup(ThemePreset preset) {
int waveBlending; int waveBlending;
const char *AText, *BText; const char *AText, *BText;
bool good_cfg = config_read_file(&cfg, tmp_path); bool good_cfg = config_read_file(&cfg, tmp_path);
if(!good_cfg){//config file is messed up
config_t tmp = {0};
cfg = tmp;//clear the config
config_init(&cfg);/*reinitize so that we can create the theme.cfg with the default theme (TODO:NightlyFox)*/
}
switch (preset) { switch (preset) {
case THEME_PRESET_LIGHT: case THEME_PRESET_LIGHT:
default: default:
themeDefault = &themeLight; themeDefault = &themeLight;
if (good_cfg) if (good_cfg)
theme = config_lookup(&cfg, "lightTheme"); theme = config_lookup(&cfg, "lightTheme");
else{
/*(TODO:NightlyFox)
theme.cfg file does not exist or is corrupted/misconfigured!
setup config here with default themes*/
}
break; break;
case THEME_PRESET_DARK: case THEME_PRESET_DARK:
themeDefault = &themeDark; themeDefault = &themeDark;
if (good_cfg) if (good_cfg)
theme = config_lookup(&cfg, "darkTheme"); theme = config_lookup(&cfg, "darkTheme");
else{
/*(TODO:NightlyFox) theme.cfg
file does not exist or is corrupted/misconfigured!
setup config here with default themes*/
}
break; break;
} }
/*(TODO:NightlyFox) write the config here
so you only have to do it once*/
if (good_cfg) { if (good_cfg) {
if (theme != NULL) { if (theme != NULL) {
if (!colorFromSetting(config_setting_lookup(theme, "textColor"), &text)) if (!colorFromSetting(config_setting_lookup(theme, "textColor"), &text))
@ -151,4 +134,4 @@ void themeStartup(ThemePreset preset) {
themeCurrent = *themeDefault; themeCurrent = *themeDefault;
} }
config_destroy(&cfg); config_destroy(&cfg);
} }