Test fix for saving bug

pull/25/head
parent 3a859096aa
commit be794cd2c1

@ -220,10 +220,11 @@ void on_save(){
char *pack_code_name, *pack_version, *pack_arch, *pack_depends;
int pack_status=0;
gboolean moved=0;
char *icon;
char *pack_sign;
gboolean pack_signed=0;
gtk_tree_model_get(GTK_TREE_MODEL(main_config.tree_store),&childIter,1,&pack_name,2,&pack_path,3,&pack_status,4,&pack_old_repo,5,&pack_new_repo,6,&moved,9,&pack_code_name,10,&pack_version,11,&pack_arch,12,&pack_depends,13,&pack_sign,14,&pack_signed,-1);
gtk_tree_model_get(GTK_TREE_MODEL(main_config.tree_store),&childIter,0,&icon,1,&pack_name,2,&pack_path,3,&pack_status,4,&pack_old_repo,5,&pack_new_repo,6,&moved,9,&pack_code_name,10,&pack_version,11,&pack_arch,12,&pack_depends,13,&pack_sign,14,&pack_signed,-1);
if (!pack_path) continue;
char *pack_sign_paths;
pack_sign_paths = yon_char_new(pack_path);
@ -245,17 +246,18 @@ void on_save(){
yon_dictionary_add_or_create_if_exists_with_data(pack_groups->data,yon_char_new(pack_sign),dict);
}
}
if (pack_status==1){
printf("%d\n",pack_status);
if (pack_status==1||!strcmp(icon,document_added)){
add_packages = yon_char_unite(add_packages ? yon_char_append(add_packages,",") : "",pack_path,NULL);
yon_char_divide(pack_path,yon_char_find_last(pack_path,'/'));
pack_path = yon_char_unite(origin_flagged,"/pool/overlay/",pack_path,NULL);
gtk_tree_store_set(main_config.tree_store,&childIter,2,pack_path,-1);
repostatus=1;
} else if (pack_status==-1){
} else if (pack_status==-1||!strcmp(icon,document_deleted)){
remove_packages = yon_char_unite(remove_packages ? yon_char_append(remove_packages,",") : "",pack_code_name,NULL);
}
if (pack_status==1) gtk_tree_store_set(main_config.tree_store,&childIter,0,document_no_edits,3,0,-1);
if (pack_status == -1){
if (pack_status==1||!strcmp(icon,document_added)) gtk_tree_store_set(main_config.tree_store,&childIter,0,document_no_edits,3,0,-1);
if (pack_status == -1||!strcmp(icon,document_deleted)){
GtkTreeIter *deleteIter = gtk_tree_iter_copy(&childIter);
if (!gtk_tree_model_iter_previous(GTK_TREE_MODEL(main_config.tree_store),deleteIter)){
gtk_tree_iter_free(deleteIter);
@ -290,10 +292,8 @@ void on_save(){
if (add_signed_command){ yon_launch(add_signed_command);
yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);}
if (add_command) { yon_launch(add_command);
printf("%s\n",add_command);
yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);}
if (remove_command) { yon_launch(remove_command);
printf("%s\n",remove_command);
yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);}
if (pack_groups){
dictionary *dct;
@ -305,7 +305,6 @@ void on_save(){
}
char *sign_command = yon_char_unite(command, " add -f -d ",origin_flagged," -r ",name_flagged," --sign-pkg ", dct->key," -p $(find ",origin_flagged,"/pool/overlay -name ", signed_packs,")",NULL);
yon_launch(sign_command);
printf("%s\n",sign_command);
}
}
@ -313,7 +312,6 @@ void on_save(){
char *repo_sign_command = yon_char_unite(command, " add -f -d ",origin_flagged, " -r ", name_flagged, " --sign-repo ", repo_sign_flagged ,NULL);
yon_window_config_add_custom_parameter(yon_char_unite(origin_flagged,NULL),"signatures",repo_sign_flagged_full,YON_TYPE_STRING);
yon_launch(repo_sign_command);
printf("%s\n",repo_sign_command);
}
}
}
@ -676,9 +674,10 @@ void yon_add_file(main_window *widgets){
else if (strstr(p,"Depends On")) packdepends = yon_char_new(stringe);
else if (strstr(p,"Depends On")) packdepends = yon_char_new(stringe);
}
int add = 1;
GtkTreeIter *iter = yon_repo_append(widgets,filename,YON_REPO_LINE_FILE_TYPE);
gtk_tree_view_expand_to_path(GTK_TREE_VIEW(widgets->RepoTree),gtk_tree_model_get_path(GTK_TREE_MODEL(main_config.tree_store),iter));
gtk_tree_store_set(main_config.tree_store,iter,0,document_added,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,filename,9,packname,10,packver,11,packarch,12,packdepends,-1);
gtk_tree_store_set(main_config.tree_store,iter,0,document_added,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,filename,3,add,9,packname,10,packver,11,packarch,12,packdepends,-1);
}
on_tree_selection_changed(NULL,widgets);

Loading…
Cancel
Save