okra pushed a commit to branch master.

http://git.enlightenment.org/apps/ephoto.git/commit/?id=ff28d742535f18691f9e7985c70612bed2c759ba

commit ff28d742535f18691f9e7985c70612bed2c759ba
Author: Stephen Houston <smhousto...@gmail.com>
Date:   Tue Jan 19 15:10:37 2016 -0600

    Ephoto: Only update thumbs on monitor call when the thumb is in the current 
directory.
---
 src/bin/ephoto_main.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c
index d27c1d0..858ed06 100644
--- a/src/bin/ephoto_main.c
+++ b/src/bin/ephoto_main.c
@@ -462,6 +462,16 @@ _monitor_created(void *data, int type EINA_UNUSED, void 
*event)
 {
    Ephoto *ephoto = data;
    Eio_Monitor_Event *ev = event;
+   char file[PATH_MAX], dir[PATH_MAX], p[PATH_MAX];
+
+   snprintf(file, PATH_MAX, "%s", ev->filename);
+   snprintf(p, PATH_MAX, "%s", ephoto->config->directory);
+   snprintf(dir, PATH_MAX, "%s", dirname(file));
+
+   if (strlen(p) != strlen(dir))
+     return ECORE_CALLBACK_PASS_ON;
+   if (strcmp(p, dir))
+     return ECORE_CALLBACK_PASS_ON;
 
    if (!strncmp("image/", efreet_mime_type_get(ev->filename), 6))
      {
@@ -515,6 +525,16 @@ _monitor_deleted(void *data, int type EINA_UNUSED, void 
*event)
 {
    Ephoto *ephoto = data;
    Eio_Monitor_Event *ev = event;
+   char file[PATH_MAX], dir[PATH_MAX], p[PATH_MAX];
+
+   snprintf(file, PATH_MAX, "%s", ev->filename);
+   snprintf(p, PATH_MAX, "%s", ephoto->config->directory);
+   snprintf(dir, PATH_MAX, "%s", dirname(file));
+
+   if (strlen(p) != strlen(dir))
+     return ECORE_CALLBACK_PASS_ON;
+   if (strcmp(p, dir))
+     return ECORE_CALLBACK_PASS_ON;
 
    if (!strncmp("image/", efreet_mime_type_get(ev->filename), 6))
      {
@@ -545,6 +565,16 @@ _monitor_modified(void *data, int type EINA_UNUSED, void 
*event)
 {
    Ephoto *ephoto = data;
    Eio_Monitor_Event *ev = event;
+   char file[PATH_MAX], dir[PATH_MAX], p[PATH_MAX];
+
+   snprintf(file, PATH_MAX, "%s", ev->filename);
+   snprintf(p, PATH_MAX, "%s", ephoto->config->directory);
+   snprintf(dir, PATH_MAX, "%s", dirname(file));
+
+   if (strlen(p) != strlen(dir))
+     return ECORE_CALLBACK_PASS_ON;
+   if (strcmp(p, dir))
+     return ECORE_CALLBACK_PASS_ON;
 
    if (!strncmp("image/", efreet_mime_type_get(ev->filename), 6))
      {

-- 


Reply via email to