Enlightenment CVS committal
Author : codewarrior
Project : e17
Module : apps/exhibit
Dir : e17/apps/exhibit/src/bin
Modified Files:
exhibit_model_wobbly.c exhibit_model_wobbly.h exhibit_thumb.c
Log Message:
- when image is changed and saved, update its thumb.
===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_model_wobbly.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- exhibit_model_wobbly.c 3 May 2007 10:30:41 -0000 1.5
+++ exhibit_model_wobbly.c 3 May 2007 13:06:17 -0000 1.6
@@ -34,7 +34,7 @@
static int _wobbly_width_get(Etk_Tree_Model *model, void *cell_data,
Evas_Object *cell_objects[ETK_TREE_MAX_OBJECTS_PER_MODEL]);
static void _wobbly_resize_cb(void *data, Evas *e, Evas_Object *obj, void
*event_info);
static void _wobbly_cache_free_cb(Evas_Object *object, void *data);
-/* static void _wobbly_cache_remove(Etk_Tree_Model *model, Evas_Object
*object); */
+static void _wobbly_cache_remove(Etk_Tree_Model *model, const char *filename,
const char *key);
/* TODOC */
Etk_Tree_Model *etk_tree_model_wobbly_new(void)
@@ -53,7 +53,7 @@
model->objects_cache = _wobbly_objects_cache;
model->render = _wobbly_render;
model->width_get = _wobbly_width_get;
-/* model->cache_remove = _wobbly_cache_remove; */
+ model->cache_remove = _wobbly_cache_remove;
wobbly_model->cache = etk_cache_new(50);
etk_cache_free_callback_set(wobbly_model->cache, _wobbly_cache_free_cb,
NULL);
@@ -275,15 +275,13 @@
evas_object_del(image);
}
-#if 0
/* Wobbly: delete a certain evas object from the model's cache */
-static void _wobbly_cache_remove(Etk_Tree_Model *model, Evas_Object *object)
+static void _wobbly_cache_remove(Etk_Tree_Model *model, const char *filename,
const char *key)
{
Etk_Tree_Model_Wobbly *wobbly_model;
if (!(wobbly_model = (Etk_Tree_Model_Wobbly *)model))
return;
- etk_cache_remove(wobbly_model->cache, object);
+ etk_cache_remove(wobbly_model->cache, etk_cache_find(wobbly_model->cache,
filename, key));
}
-#endif
===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_model_wobbly.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- exhibit_model_wobbly.h 3 May 2007 10:30:41 -0000 1.4
+++ exhibit_model_wobbly.h 3 May 2007 13:06:17 -0000 1.5
@@ -4,6 +4,5 @@
#include <Etk.h>
Etk_Tree_Model *etk_tree_model_wobbly_new(void);
-/* Etk_Cache *etk_tree_model_wobbly_cache_get(Etk_Tree_Model *model); */
#endif
===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_thumb.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- exhibit_thumb.c 3 May 2007 10:30:41 -0000 1.13
+++ exhibit_thumb.c 3 May 2007 13:06:17 -0000 1.14
@@ -76,7 +76,7 @@
signal(SIGILL, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGBUS, SIG_DFL);
-
+
thumb = thumb_list->data;
if(_ex_file_is_ebg(thumb->name))
epsilon_key_set(thumb->ep, "desktop/background");
@@ -138,6 +138,7 @@
Epsilon *ep;
char file[PATH_MAX];
char *icol_string;
+ char *old_thumb;
Ex_Tab *tab;
Ex_Thumb *thumb;
@@ -147,7 +148,7 @@
etk_tree_row_fields_get(
row,
etk_tree_nth_col_get(ETK_TREE(tree), 0),
- NULL,
+ &old_thumb,
NULL,
&icol_string,
NULL);
@@ -158,8 +159,13 @@
tab->cur_path, icol_string);
ep = epsilon_new(file);
- if (epsilon_exists(ep))
- ecore_file_unlink(epsilon_thumb_file_get(ep));
+
+ /* For some reason, if we dont call this, something goes wrong
+ * Need to look into epsilon to see what this function is doing that makes
+ * everything work well.
+ */
+ epsilon_exists(ep);
+ ecore_file_unlink(old_thumb);
thumb = calloc(1, sizeof(Ex_Thumb));
thumb->ep = ep;
@@ -169,5 +175,6 @@
thumb_list = evas_list_append(thumb_list, thumb);
thumb->selected = ETK_FALSE;
thumb->is_update = ETK_TRUE;
+ etk_tree_model_cache_remove(thumb->tab->imodel, old_thumb, NULL);
if(pid == -1) _ex_thumb_generate();
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs