Enlightenment CVS committal
Author : atmosphere
Project : e17
Module : apps/entice
Dir : e17/apps/entice/src/bin
Modified Files:
entice.c entice.h main.c prefs.c signals_image.c
Log Message:
file deletion works.
You can remove the current image from entice's list or delete it
completely from disk. It'll automatically load the next image if
deletion/removal is successful.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/entice.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- entice.c 17 Oct 2003 21:36:08 -0000 1.7
+++ entice.c 18 Oct 2003 20:38:55 -0000 1.8
@@ -362,12 +362,39 @@
}
}
+void
+entice_delete_current(void)
+{
+ if (entice && entice->current)
+ {
+ int result = 0;
+
+ result = entice_file_delete(entice_image_file_get(entice->current));
+
+ if (!result)
+ edje_object_signal_emit(entice->edje, "EnticeImageNext", "");
+ }
+}
+void
+entice_remove_current(void)
+{
+ if (entice && entice->current)
+ {
+ int result = 0;
+
+ result = entice_file_remove(entice_image_file_get(entice->current));
+ if (!result)
+ edje_object_signal_emit(entice->edje, "EnticeImageNext", "");
+ }
+
+}
+
/**
- * entice_fil_del - delete the file from our image list
+ * entice_file_remove - remove the file from our image list
* @file - the filename we want to nuke
*/
int
-entice_file_del(const char *file)
+entice_file_remove(const char *file)
{
int result = 0;
Evas_Object *o = NULL;
@@ -376,63 +403,52 @@
if (file)
{
snprintf(buf, PATH_MAX, "%s", file);
- if ((ptr = realpath(buf, path)))
+ if ((o = evas_hash_find(entice->thumb.hash, buf)))
{
- if ((o = evas_hash_find(entice->thumb.hash, path)))
- {
- entice->thumb.list = evas_list_remove(entice->thumb.list, o);
- entice->thumb.hash = evas_hash_del(entice->thumb.hash, path, o);
- /* FIXME container_vomit(o); */
+ entice->thumb.list = evas_list_remove(entice->thumb.list, o);
+ entice->thumb.hash = evas_hash_del(entice->thumb.hash, buf, o);
+ e_container_element_remove(entice->container, o);
+ evas_object_del(o);
+ /* FIXME container_vomit(o); */
#if 0
- e_thumb_free(o);
+ e_thumb_free(o);
#endif
- }
- else
- result = 1;
}
else
- result = 2;
+ result = 1;
}
else
- result = 3;
+ result = 2;
return (result);
}
/**
- * entice_file_del_from_fs - delete the file from our list, and off disk
+ * entice_file_delete - delete the file from our list, and off disk
* @file - the filename of the image we wanna nuke
*/
int
-entice_file_del_from_fs(const char *file)
+entice_file_delete(const char *file)
{
int result = 0;
Evas_Object *o = NULL;
- char buf[PATH_MAX], path[PATH_MAX], *ptr = NULL;
+ char buf[PATH_MAX];
if (file)
{
snprintf(buf, PATH_MAX, "%s", file);
- if ((ptr = realpath(buf, path)))
+ if ((o = evas_hash_find(entice->thumb.hash, buf)))
{
- if ((o = evas_hash_find(entice->thumb.hash, path)))
- {
- entice->thumb.list = evas_list_remove(entice->thumb.list, o);
- entice->thumb.hash = evas_hash_del(entice->thumb.hash, path, o);
- /* FIXME container_vomit(o); */
-#if 0
- e_thumb_free(o);
- unlink(path);
-
-#endif
- }
- else
- result = 1;
+ entice->thumb.list = evas_list_remove(entice->thumb.list, o);
+ entice->thumb.hash = evas_hash_del(entice->thumb.hash, buf, o);
+ e_container_element_remove(entice->container, o);
+ evas_object_del(o);
+ unlink(buf);
}
else
- result = 2;
+ result = 1;
}
else
- result = 3;
+ result = 2;
return (result);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/entice.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- entice.h 14 Oct 2003 18:33:29 -0000 1.10
+++ entice.h 18 Oct 2003 20:38:55 -0000 1.11
@@ -66,5 +66,7 @@
void entice_flip_horizontal(void);
void entice_preview_thumb(Evas_Object * o);
+void entice_delete_current(void);
+void entice_remove_current(void);
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/main.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- main.c 18 Oct 2003 06:59:04 -0000 1.15
+++ main.c 18 Oct 2003 20:38:55 -0000 1.16
@@ -45,6 +45,7 @@
win_resize_cb(Ecore_Evas * ee)
{
int x, y, w, h;
+
if (ee)
{
ecore_evas_geometry_get(ee, &x, &y, &w, &h);
@@ -61,6 +62,7 @@
win_move_cb(Ecore_Evas * ee)
{
int x, y, w, h;
+
if (ee)
{
ecore_evas_geometry_get(ee, &x, &y, &w, &h);
@@ -76,6 +78,7 @@
win_del_cb(Ecore_Evas * ee)
{
int x, y, w, h;
+
if (ee)
{
ecore_evas_geometry_get(ee, &x, &y, &w, &h);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/prefs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- prefs.c 18 Oct 2003 18:09:24 -0000 1.6
+++ prefs.c 18 Oct 2003 20:38:55 -0000 1.7
@@ -99,33 +99,39 @@
void
entice_config_geometry_get(int *x, int *y, int *w, int *h)
{
- if(econfig)
- {
- if(x) *x = econfig->x;
- if(y) *y = econfig->y;
- if(w) *w = econfig->w;
- if(h) *h = econfig->h;
- }
+ if (econfig)
+ {
+ if (x)
+ *x = econfig->x;
+ if (y)
+ *y = econfig->y;
+ if (w)
+ *w = econfig->w;
+ if (h)
+ *h = econfig->h;
+ }
}
void
entice_config_geometry_set(int x, int y, int w, int h)
{
- if(econfig)
- {
- char file[PATH_MAX];
- econfig->x = x;
- econfig->y = y;
- econfig->w = w;
- econfig->h = h;
-
- snprintf(file, PATH_MAX, "%s/.entice.db", getenv("HOME"));
- E_DB_INT_SET(file, "/entice/x", x)
- E_DB_INT_SET(file, "/entice/y", y)
- E_DB_INT_SET(file, "/entice/w", w)
- E_DB_INT_SET(file, "/entice/h", h)
- e_db_flush();
- }
+ if (econfig)
+ {
+ char file[PATH_MAX];
+
+ econfig->x = x;
+ econfig->y = y;
+ econfig->w = w;
+ econfig->h = h;
+
+ snprintf(file, PATH_MAX, "%s/.entice.db", getenv("HOME"));
+ E_DB_INT_SET(file, "/entice/x", x);
+ E_DB_INT_SET(file, "/entice/y", y);
+ E_DB_INT_SET(file, "/entice/w", w);
+ E_DB_INT_SET(file, "/entice/h", h);
+ e_db_flush();
+ }
}
+
/**
* entice_config_new - allocate a new 0'd out Entice_Config
* Returns a valid 0'd out Entice_Config
@@ -228,13 +234,13 @@
(db, "/entice/cache/image", &econfig->cache.image))
econfig->cache.image = 4;
if (!e_db_int_get(db, "/entice/x", &econfig->x))
- econfig->x = 0;
+ econfig->x = 0;
if (!e_db_int_get(db, "/entice/y", &econfig->y))
- econfig->y = 0;
+ econfig->y = 0;
if (!e_db_int_get(db, "/entice/w", &econfig->w))
- econfig->y = 320;
+ econfig->y = 320;
if (!e_db_int_get(db, "/entice/h", &econfig->h))
- econfig->y = 240;
+ econfig->y = 240;
e_db_close(db);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/signals_image.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- signals_image.c 14 Oct 2003 18:33:29 -0000 1.4
+++ signals_image.c 18 Oct 2003 20:38:55 -0000 1.5
@@ -10,6 +10,7 @@
_entice_delete_current(void *data, Evas_Object * o, const char *emission,
const char *source)
{
+ entice_delete_current();
return;
data = NULL;
o = NULL;
@@ -22,6 +23,7 @@
_entice_remove_current(void *data, Evas_Object * o, const char *emission,
const char *source)
{
+ entice_remove_current();
return;
data = NULL;
o = NULL;
-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise
Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs