From e321578a0851abdbdd1fceb24ad28340ec74edd0 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 11 Feb 2025 15:15:12 +0600 Subject: [PATCH] Fixes --- source/ubl-settings-logging.c | 23 ++++++++++++----------- ubl-settings-logging-logrotate.glade | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index 20215e3..dd14cf2 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -1569,13 +1569,16 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),3); }else if (!strcmp(parsed[i],"yearly")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),4); - }else if (!strcmp(parsed[i],"olddir")){ + }else if (strstr(parsed[i],"olddir")){ char *value = strstr(parsed[i]," "); - if (value) value++; + if (value){ value++; + gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),2); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),1); + } gtk_entry_set_text(GTK_ENTRY(window->FileAmountEntry),value); - gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),1); }else if (!strcmp(parsed[i],"noolddir")){ - gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),2); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),0); }else if (strstr(parsed[i],"su")){ char *value = strstr(parsed[i]," "); if (value) value++; @@ -2679,13 +2682,11 @@ void on_log_remove(GtkWidget *, main_window *widgets){ int stay_paths=0; char *paths; gtk_tree_model_get(model,&iter,1,&paths,4,&stay_paths,-1); - char *stay = ""; - for (int i=0;ilist,&iter,1,paths,3,1,-1); + int size; + config_str parsed = yon_char_parse(paths,&size,"\n"); + char *stay = yon_char_parsed_to_string_for_iters(parsed,size,"\n",stay_paths); + yon_char_parsed_free(parsed,size); + gtk_list_store_set(widgets->list,&iter,1,stay,3,1,-1); gtk_widget_set_sensitive(widgets->RemoveButton,0); } } diff --git a/ubl-settings-logging-logrotate.glade b/ubl-settings-logging-logrotate.glade index 3ce8738..169fe5c 100644 --- a/ubl-settings-logging-logrotate.glade +++ b/ubl-settings-logging-logrotate.glade @@ -34,6 +34,7 @@ 10 + 1 999999999 1 10