Added config parameter valid checking function

pull/288/head
parent 724e3a0207
commit e7c1bef9ac
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -89,7 +89,29 @@ void yon_gtk_tree_view_select_first(GtkTreeView *target){
}
}
int yon_config_check_valid(){
int size;
config_str parameters = yon_config_get_all_keys(&size);
int invalid_found = 0;
for (int i=0;i<size;i++){
int open_brackets = yon_char_count(parameters[i],"[");
int close_brackets = yon_char_count(parameters[i],"]");
if (open_brackets!=close_brackets||strstr(parameters[i],"\n")){
yon_config_remove_by_key(parameters[i]);
invalid_found = 1;
}
}
if (invalid_found){
yon_ubl_status_box_render(CONFIG_INVALID_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
return 0;
}
return 1;
}
void yon_interface_update(main_window *widgets){
if (!yon_config_check_valid()) return;
on_system_update(NULL,widgets);
int size;
GtkTreeIter iter;

@ -625,4 +625,5 @@ char *yon_user_get_system_groups(char *target_login);
int yon_system_group_sync(char *group);
int yon_system_user_sync(char *user);
void on_homedir_changed(GtkComboBox *self, GtkWidget *target);
int yon_config_check_valid();
#endif
Loading…
Cancel
Save