|
|
|
@ -25,18 +25,15 @@ void model_null_str_writing(config_u_g_p* _config) {
|
|
|
|
|
_config->loaded_keys = yon_char_new(empty_str);
|
|
|
|
|
_config->type_arr = yon_char_new(empty_str);
|
|
|
|
|
_config->id = -3;
|
|
|
|
|
_config->status_set = -3;
|
|
|
|
|
_config->soft_restriction_size = -3;
|
|
|
|
|
_config->soft_restriction_file = -3;
|
|
|
|
|
_config->severe_limitation_size = -3;
|
|
|
|
|
_config->severe_limitation_file = -3;
|
|
|
|
|
_config->deferring_size = -3;
|
|
|
|
|
_config->deferring_file = -3;
|
|
|
|
|
_config->deferring_size = 0;
|
|
|
|
|
_config->deferring_file = 0;
|
|
|
|
|
_config->size_memory_pow = -3;
|
|
|
|
|
_config->soft_restriction_size_pow = -3;
|
|
|
|
|
_config->soft_restriction_file_pow = -3;
|
|
|
|
|
_config->severe_limitation_size_pow = -3;
|
|
|
|
|
_config->severe_limitation_file_pow = -3;
|
|
|
|
|
vector_init(&_config->actors);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -46,17 +43,18 @@ char* format_actors(vector* vec_actors) {
|
|
|
|
|
split_simvol[0] = 0;
|
|
|
|
|
split_simvol[1] = 0;
|
|
|
|
|
char* str_actors = NULL;
|
|
|
|
|
for (int i = 0; i < vec_actors->pfVectorTotal(vec_actors); i++) {
|
|
|
|
|
str_actors = (char*)vec_actors->pfVectorGet(vec_actors, i);
|
|
|
|
|
if (str_actors) {
|
|
|
|
|
str_actors = yon_char_unite(str_all,split_simvol, str_actors, NULL);
|
|
|
|
|
split_simvol[0] = ',';
|
|
|
|
|
split_simvol[1] = '\0';
|
|
|
|
|
free(str_actors);
|
|
|
|
|
if (vec_actors->vectorList.total> 0) {
|
|
|
|
|
for (int i = 0; i < vec_actors->vectorList.total; i++) {
|
|
|
|
|
str_actors = (char*)vec_actors->pfVectorGet(vec_actors, i);
|
|
|
|
|
if (str_actors) {
|
|
|
|
|
str_all = yon_char_unite(str_all,split_simvol, str_actors, NULL); // Баг
|
|
|
|
|
split_simvol[0] = ',';
|
|
|
|
|
split_simvol[1] = '\0';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (strlen(str_all) < 5) {
|
|
|
|
|
|
|
|
|
|
if (strlen(str_all) < 3) {
|
|
|
|
|
return yon_char_new("-");
|
|
|
|
|
}
|
|
|
|
|
return str_all;
|
|
|
|
@ -104,6 +102,7 @@ int fill_tree_view_user_group(config_all* all_config, char* disk, hotebook* widg
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widget->liststore);
|
|
|
|
|
if (flag_gui_add == 0) {
|
|
|
|
|
g_object_ref(widget->liststore);
|
|
|
|
|
// gtk_tree_view_set_model(GTK_TREE_VIEW(widget->tree_view), NULL);
|
|
|
|
|
gtk_list_store_clear(widget->liststore);
|
|
|
|
|
}
|
|
|
|
|
int flag_searhc = 0;
|
|
|
|
@ -114,26 +113,28 @@ int fill_tree_view_user_group(config_all* all_config, char* disk, hotebook* widg
|
|
|
|
|
else {
|
|
|
|
|
vec_temp = &all_config->v_group;
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < vec_temp->pfVectorTotal(vec_temp); i++) {
|
|
|
|
|
config_u_g_p* _config = (config_u_g_p*)vec_temp->pfVectorGet(vec_temp, i);
|
|
|
|
|
if (strcmp(_config->type_arr, str_fill) == 0 && strstr(_config->UNIX_file, disk)) {
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
flag_searhc++;
|
|
|
|
|
gtk_list_store_append(widget->liststore,&iter);
|
|
|
|
|
char* deferring_size = wrapper_str_time(_config->deferring_size);
|
|
|
|
|
char* deferring_file = wrapper_str_time(_config->deferring_file);
|
|
|
|
|
gtk_list_store_set(widget->liststore,&iter,
|
|
|
|
|
0,format_actors(&_config->actors),
|
|
|
|
|
1,_config->quota,
|
|
|
|
|
2,_config->size_memory,
|
|
|
|
|
3,philos_format_cfg_str_size_memory("", _config->soft_restriction_size,_config->soft_restriction_size_pow),
|
|
|
|
|
4,philos_format_cfg_str_size_memory("", _config->severe_limitation_size,_config->severe_limitation_size_pow),
|
|
|
|
|
5,yon_char_from_int(_config->soft_restriction_file),
|
|
|
|
|
6,_config->files,
|
|
|
|
|
7,yon_char_from_int(_config->severe_limitation_file),
|
|
|
|
|
8,deferring_size,
|
|
|
|
|
9,deferring_file,
|
|
|
|
|
-1);
|
|
|
|
|
if (vec_temp->vectorList.total > 0) {
|
|
|
|
|
for (int i = 0; i < vec_temp->vectorList.total; i++) {
|
|
|
|
|
config_u_g_p* _config = (config_u_g_p*)vec_temp->pfVectorGet(vec_temp, i);
|
|
|
|
|
if (strcmp(_config->type_arr, str_fill) == 0 && strstr(_config->UNIX_file, disk)) {
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
flag_searhc++;
|
|
|
|
|
gtk_list_store_append(widget->liststore,&iter);
|
|
|
|
|
char* deferring_size = wrapper_str_time(_config->deferring_size);
|
|
|
|
|
char* deferring_file = wrapper_str_time(_config->deferring_file);
|
|
|
|
|
gtk_list_store_set(widget->liststore,&iter,
|
|
|
|
|
0,format_actors(&_config->actors),
|
|
|
|
|
1,_config->quota,
|
|
|
|
|
2,_config->size_memory,
|
|
|
|
|
3,philos_format_cfg_str_size_memory("", _config->soft_restriction_size,_config->soft_restriction_size_pow),
|
|
|
|
|
4,philos_format_cfg_str_size_memory("", _config->severe_limitation_size,_config->severe_limitation_size_pow),
|
|
|
|
|
5,yon_char_from_int(_config->soft_restriction_file),
|
|
|
|
|
6,_config->files,
|
|
|
|
|
7,yon_char_from_int(_config->severe_limitation_file),
|
|
|
|
|
8,deferring_size,
|
|
|
|
|
9,deferring_file,
|
|
|
|
|
-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag_gui_add != 0) {
|
|
|
|
@ -156,4 +157,5 @@ char* wrapper_str_time(size_t seconds) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return t.str_time;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|