Enlightenment CVS committal Author : leviathan Project : e17 Module : apps/exhibit
Dir : e17/apps/exhibit/src/bin Modified Files: exhibit.h exhibit_main.c exhibit_sort.c exhibit_tab.c exhibit_tab.h Log Message: Do away with the images list, use row data to store the image path This fixes the sorting issues =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit.h,v retrieving revision 1.50 retrieving revision 1.51 diff -u -3 -r1.50 -r1.51 --- exhibit.h 2 Oct 2007 21:05:00 -0000 1.50 +++ exhibit.h 4 Oct 2007 10:35:55 -0000 1.51 @@ -164,7 +164,6 @@ Etk_Bool fit_window; Ecore_File_Monitor *monitor; - Evas_List *images; Evas_List *dirs; Etk_Widget *image; =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.129 retrieving revision 1.130 diff -u -3 -r1.129 -r1.130 --- exhibit_main.c 2 Oct 2007 21:05:00 -0000 1.129 +++ exhibit_main.c 4 Oct 2007 10:35:55 -0000 1.130 @@ -263,7 +263,6 @@ if(!realpath(image, imagereal)) snprintf(imagereal, PATH_MAX, "%s", image); - e->cur_tab->images = evas_list_append(e->cur_tab->images, strdup(imagereal)); _ex_main_itree_add(imagereal, data->selected_file); if (i == MAX_INSERTS_PER_ITERATION) @@ -385,13 +384,17 @@ data->num = FILELIST_SIZE * j + i; closedir(dir); - _ex_tab_imagelist_free(e->cur_tab); - ecore_timer_add(0.001, _ex_main_populate_files_timer_cb, data); } void +_ex_main_row_data_free(void *data) { + if (data) + free(data); +} + +void _ex_main_itree_add(const char *file, const char *selected_file) { Etk_Tree_Row *row; @@ -412,6 +415,7 @@ e->cur_tab->icol, NULL, NULL, basename((char *) file), NULL); + etk_tree_row_data_set_full(row, strdup(file), _ex_main_row_data_free); return; } @@ -434,6 +438,7 @@ e->cur_tab->icol, PACKAGE_DATA_DIR"/gui.edj", "thumb_loading", basename((char *) file), NULL); + etk_tree_row_data_set_full(row, strdup(file), _ex_main_row_data_free); } static void @@ -488,7 +493,6 @@ _ex_main_itree_add(path, path); else _ex_main_itree_add(path, NULL); - e->cur_tab->images = evas_list_append(e->cur_tab->images, strdup(path)); break; default: D(("Unknown ecore file event occured\n")); =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_sort.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- exhibit_sort.c 2 Oct 2007 02:39:43 -0000 1.15 +++ exhibit_sort.c 4 Oct 2007 10:35:55 -0000 1.16 @@ -73,8 +73,8 @@ if (!row1 || !row2 || !col) return 0; - etk_tree_row_fields_get(row1, col, NULL, NULL, &f1, NULL); - etk_tree_row_fields_get(row2, col, NULL, NULL, &f2, NULL); + f1 = (char *)etk_tree_row_data_get(row1); + f2 = (char *)etk_tree_row_data_get(row2); stat(f1, &s1); stat(f2, &s2); @@ -94,8 +94,8 @@ if (!row1 || !row2 || !col) return 0; - etk_tree_row_fields_get(row1, col, NULL, NULL, &f1, NULL); - etk_tree_row_fields_get(row2, col, NULL, NULL, &f2, NULL); + f1 = (char *)etk_tree_row_data_get(row1); + f2 = (char *)etk_tree_row_data_get(row2); stat(f1, &s1); stat(f2, &s2); @@ -114,8 +114,8 @@ if (!row1 || !row2 || !col) return 0; - etk_tree_row_fields_get(row1, col, NULL, NULL, &f1, NULL); - etk_tree_row_fields_get(row2, col, NULL, NULL, &f2, NULL); + f1 = (char *)etk_tree_row_data_get(row1); + f2 = (char *)etk_tree_row_data_get(row2); return _ex_sort_resol(f1, f2); } @@ -166,7 +166,6 @@ { etk_tree_col_sort_full(etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 0), _ex_sort_itree_name_compare_cb, NULL, ETK_TRUE); - _ex_tab_imagelist_rebuild(); return ETK_TRUE; } @@ -175,7 +174,6 @@ { etk_tree_col_sort_full(e->cur_tab->icol, _ex_sort_itree_size_compare_cb, NULL, ETK_TRUE); - _ex_tab_imagelist_rebuild(); return ETK_TRUE; } @@ -184,7 +182,6 @@ { etk_tree_col_sort_full(e->cur_tab->icol, _ex_sort_itree_resol_compare_cb, NULL, ETK_TRUE); - _ex_tab_imagelist_rebuild(); return ETK_TRUE; } @@ -193,7 +190,6 @@ { etk_tree_col_sort_full(e->cur_tab->icol, _ex_sort_itree_date_compare_cb, NULL, ETK_TRUE); - _ex_tab_imagelist_rebuild(); return ETK_TRUE; } =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_tab.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -3 -r1.43 -r1.44 --- exhibit_tab.c 10 Sep 2007 09:21:32 -0000 1.43 +++ exhibit_tab.c 4 Oct 2007 10:35:55 -0000 1.44 @@ -22,7 +22,6 @@ tab = calloc(1, sizeof(Ex_Tab)); //tab->num = evas_list_count(e->tabs); tab->dirs = NULL; - tab->images = NULL; if (!dir) { D(("NO DIR\n")); @@ -402,23 +401,14 @@ _ex_tab_itree_item_clicked_cb(Etk_Object *object, Etk_Tree_Row *row, void *data) { Exhibit *e; - Etk_Tree *tree; - char *icol_string; - int row_num; char *path; e = data; e->zoom = 0; _ex_main_statusbar_zoom_update(e); - tree = ETK_TREE(object); - - etk_tree_row_fields_get(row, etk_tree_nth_col_get(tree, 0), NULL, NULL, - &icol_string, NULL); + path = (char *)etk_tree_row_data_get(row); - row_num = etk_tree_row_num_get(tree, row); - path = (char *) evas_list_nth(e->cur_tab->images, row_num); - _ex_main_image_set(e, path); } @@ -440,47 +430,4 @@ _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } } - -void -_ex_tab_imagelist_rebuild() -{ - Ex_Tab *tab; - Etk_Tree_Row * iter; - char * icol_string; - - tab = e->cur_tab; - _ex_tab_imagelist_free(tab); - - // walk the tree and rebuild the image list - for (iter = etk_tree_first_row_get(ETK_TREE(tab->itree)); - iter; - iter = etk_tree_row_walk_next(iter, ETK_TRUE)) - { - char *image; - image = (char *)calloc(PATH_MAX, sizeof(char)); - - etk_tree_row_fields_get(iter, - etk_tree_nth_col_get(ETK_TREE(tab->itree), 0), NULL, NULL, - &icol_string, NULL); - - snprintf(image, PATH_MAX, "%s%s", tab->dir, icol_string); - - tab->images = evas_list_append(tab->images, image); - - } - -} - -void -_ex_tab_imagelist_free(Ex_Tab *tab) -{ - Evas_List *l; - if (!tab) return; - - for (l = tab->images; l; l = l->next) - if (l->data) free(l->data); - tab->images = evas_list_free(tab->images); -} - - =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_tab.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- exhibit_tab.h 10 Sep 2007 09:21:32 -0000 1.7 +++ exhibit_tab.h 4 Oct 2007 10:35:55 -0000 1.8 @@ -12,6 +12,4 @@ void _ex_tab_current_zoom_one_to_one(Exhibit *e); void _ex_tab_current_fit_to_window(Exhibit *e); Ex_Tab *_ex_tab_find_by_itree(Etk_Tree *itree); -void _ex_tab_imagelist_rebuild(); -void _ex_tab_imagelist_free(Ex_Tab *tab); #endif ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs