Enlightenment CVS committal

Author  : leviathan
Project : e17
Module  : apps/exhibit

Dir     : e17/apps/exhibit/src/bin


Modified Files:
        exhibit_main.c exhibit_sort.c exhibit_tab.c exhibit_tab.h 


Log Message:
Synchronize image list with the tree after sorting

===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_main.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -3 -r1.121 -r1.122
--- exhibit_main.c      5 Sep 2007 10:15:50 -0000       1.121
+++ exhibit_main.c      10 Sep 2007 09:21:32 -0000      1.122
@@ -402,10 +402,7 @@
    data->num = FILELIST_SIZE * j + i;
    closedir(dir);   
 
-   // free the old images list
-   for (l = e->cur_tab->images; l; l = l->next)
-     if (l->data) free(l->data);
-   e->cur_tab->images = evas_list_free(e->cur_tab->images);
+   _ex_tab_imagelist_free(e->cur_tab);
    
    ecore_timer_add(0.001, _ex_main_populate_files_timer_cb, data);  
    
===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_sort.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- exhibit_sort.c      9 Jul 2007 23:50:41 -0000       1.13
+++ exhibit_sort.c      10 Sep 2007 09:21:32 -0000      1.14
@@ -166,6 +166,7 @@
 {    
    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();
 }
 
 void 
@@ -173,6 +174,7 @@
 {    
    etk_tree_col_sort_full(e->cur_tab->icol, _ex_sort_itree_size_compare_cb,
                          NULL, ETK_TRUE);
+   _ex_tab_imagelist_rebuild();
 }
 
 void 
@@ -180,6 +182,7 @@
 {    
    etk_tree_col_sort_full(e->cur_tab->icol, _ex_sort_itree_resol_compare_cb,
                          NULL, ETK_TRUE);
+   _ex_tab_imagelist_rebuild();
 }
 
 void 
@@ -187,6 +190,7 @@
 {    
    etk_tree_col_sort_full(e->cur_tab->icol, _ex_sort_itree_date_compare_cb,
                          NULL, ETK_TRUE);
+   _ex_tab_imagelist_rebuild();
 }
 
 void
===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_tab.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- exhibit_tab.c       5 Sep 2007 10:15:50 -0000       1.42
+++ exhibit_tab.c       10 Sep 2007 09:21:32 -0000      1.43
@@ -440,3 +440,47 @@
         _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.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- exhibit_tab.h       3 May 2007 10:30:41 -0000       1.6
+++ exhibit_tab.h       10 Sep 2007 09:21:32 -0000      1.7
@@ -12,4 +12,6 @@
 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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to