diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index ab42b25..bbbba4c 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -27,7 +27,6 @@ int yon_load_proceed(YON_CONFIG_TYPE type){ if (strstr(key,USERADD_SEARCH_macro)&&local_value){ if (parsed_size>5){ char *temp = yon_char_append(local_value,parsed[5]); - free(local_value); local_value=temp; yon_config_set(key,yon_char_new(local_value)); yon_config_set_status(key,0); @@ -2281,10 +2280,8 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w int user_shell_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userShellCombo)); if (user_shell_active>0){ - user_shell = yon_char_unite("--shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); - if (!strcmp(user_shell,SET_LABEL)){ - user_shell = yon_char_unite("--shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); - } + user_shell = yon_char_unite("--shell ",!strcmp(gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->userShellCombo)),"Set")?(char*)gtk_entry_get_text(GTK_ENTRY(window->userShellEntry)):(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); + } else user_shell=""; int user_home_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userHomeCombo)); @@ -2402,11 +2399,11 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){ if (shells[i][strlen(shells[i])-1]=='\n') shells[i][strlen(shells[i])-1]='\0'; int parsed_size=0; config_str parsed = yon_char_parse(shells[i],&parsed_size,";"); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->userShellCombo),parsed[0]); + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->userShellCombo),parsed[0],parsed[0]); yon_char_parsed_free(parsed,parsed_size); } } - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(window->userShellCombo),SET_LABEL); + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->userShellCombo),"Set",SET_LABEL); yon_char_parsed_free(shells,shell_size); gtk_combo_box_set_active(GTK_COMBO_BOX(window->userShellCombo),0); window->old_password=NULL; @@ -2557,8 +2554,7 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->userHomeCombo),2); i++; } else if (!strcmp(parameters_substring[i],"--shell")||!strcmp(parameters_substring[i],"-s")){ - int active = yon_gtk_combo_box_text_find(window->userShellCombo,parameters_substring[i+1]); - if (!active){ + if (!gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->userShellCombo),parameters_substring[i+1])){ gtk_entry_set_text(GTK_ENTRY(window->userShellEntry),parameters_substring[i+1]); gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->userShellCombo),"Set"); } @@ -2635,7 +2631,6 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ if (strstr(usershadow_sync,"shutdown")){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->UsershadowShutdownCheck),1); } - free(usershadow_sync); } }