|
|
|
@ -41,6 +41,17 @@ void model_free_vector_string(vector* vec_str) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void model_free_vector_disk_status(vector* vec_disk_status) {
|
|
|
|
|
if (vec_disk_status) {
|
|
|
|
|
if (vec_disk_status->vectorList.total> 0) {
|
|
|
|
|
for (int i = 0; i < vec_disk_status->vectorList.total; i++) {
|
|
|
|
|
disk_status* _config = (disk_status*)vec_disk_status->pfVectorGet(vec_disk_status, i);
|
|
|
|
|
// model_clear_cfg_device(_config);
|
|
|
|
|
vectorDelete(vec_disk_status, i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void model_tree_view_add(config_u_g_p* _config) {
|
|
|
|
|
model_null_str_writing(_config);
|
|
|
|
@ -319,11 +330,35 @@ void del_disk_to_vector_device(vector* vec_temp, char* str_disk) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char* format_str_del_config(config_u_g_p* _config) {
|
|
|
|
|
char* space = g_malloc0(sizeof(char)*2);
|
|
|
|
|
char* actors = yon_char_new("");
|
|
|
|
|
char* cmd = NULL;
|
|
|
|
|
for (int i = 0; i < _config->actors.vectorList.total; i++) {
|
|
|
|
|
actors = yon_char_unite(actors, space, _config->actors.pfVectorGet(&_config->actors, i), NULL);
|
|
|
|
|
space[0] = ',';
|
|
|
|
|
space[1] = '\0';
|
|
|
|
|
}
|
|
|
|
|
if (strstr(_config->type_arr, "prjquota")) {
|
|
|
|
|
if (_config->actors.vectorList.total == 0) {
|
|
|
|
|
cmd = yon_char_unite(_config->type_arr, ":", _config->UNIX_file, ":",fill_tree_view_id(_config->id), NULL);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
cmd = yon_char_unite(_config->type_arr, ":", _config->UNIX_file, ":",fill_tree_view_id(_config->id), ",", actors, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
cmd = yon_char_unite(_config->type_arr, ":", _config->UNIX_file, ":", actors, NULL);
|
|
|
|
|
}
|
|
|
|
|
free(space);
|
|
|
|
|
return cmd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void model_template_remove(vector* vec_temp, vector* vec_remove, int index) {
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
config_u_g_p* _config = (config_u_g_p*)vec_temp->pfVectorGet(vec_temp, index);
|
|
|
|
|
char* load_key = yon_char_new(_config->loaded_keys);
|
|
|
|
|
vec_remove->pfVectorAdd(vec_remove, load_key);
|
|
|
|
|
vec_remove->pfVectorAdd(vec_remove, format_str_del_config(_config));
|
|
|
|
|
model_clear_cfg(_config);
|
|
|
|
|
vec_temp->pfVectorDelete(vec_temp, index);
|
|
|
|
|
}
|
|
|
|
|