Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common
Modified Files:
evas_image_load.c evas_image_main.c
Log Message:
now limit stats per any 1 file to STAT_GAP (2 seconds).
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_image_load.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- evas_image_load.c 2 Mar 2007 23:12:10 -0000 1.38
+++ evas_image_load.c 3 Mar 2007 09:04:47 -0000 1.39
@@ -13,7 +13,6 @@
char *loader = NULL;
Evas_Module *em;
struct stat st;
-// time_t t;
if (file == NULL) return NULL;
@@ -23,14 +22,13 @@
evas_common_image_ref(im);
return im;
}
-// t = time();
if (stat(file, &st) < 0) return NULL;
im = evas_common_image_new();
if (!im) return NULL;
im->timestamp = st.st_mtime;
-// im->last_stat = t;
+ im->laststat = time(NULL);
if (lo) im->load_opts = *lo;
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_image_main.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- evas_image_main.c 2 Mar 2007 23:12:10 -0000 1.45
+++ evas_image_main.c 3 Mar 2007 09:04:47 -0000 1.46
@@ -478,7 +478,7 @@
char buf[4096 + 1024];
Evas_Object_List *l;
struct stat st;
- static time_t last_stat = 0;
+ static time_t laststat = 0;
time_t t, mt = 0;
if ((!file) && (!key)) return NULL;
@@ -501,13 +501,13 @@
else
snprintf(buf, sizeof(buf), "//@/%i/%1.5f/%ix%i//%s",
lo->scale_down_by, lo->dpi, lo->w, lo->h, file);
}
-// t = time();
im = evas_hash_find(images, buf);
+ t = time(NULL);
if (im)
{
-// if ((t - im->last_stat) < STAT_GAP)
-// return im;
-// else
+ if ((t - im->laststat) < STAT_GAP)
+ return im;
+ else
{
struct stat st;
@@ -515,20 +515,12 @@
mt = st.st_mtime;
if (mt == im->timestamp)
{
-// im->last_stat = t;
+ im->laststat = t;
+ laststat = t;
return im;
}
}
}
- else
- {
-// if ((t - last_stat) >= STAT_GAP)
-// {
- if (stat(file, &st) < 0) return NULL;
- mt = st.st_mtime;
-// }
- }
-
for (l = cache; l; l = l->next)
{
int ok;
@@ -550,21 +542,24 @@
ok++;
else continue;
-// if ((t - im->last_stat) >= STAT_GAP)
-// {
- if (im->timestamp == mt)
- ok++;
- else continue;
-// }
-// else ok++;
-
if ((lo->scale_down_by == lo2->scale_down_by) &&
(lo->dpi == lo2->dpi) && (lo->w == lo2->w) &&
(lo->h == lo2->h))
ok++;
else continue;
-// im->last_stat = t;
+ if ((t - im->laststat) >= STAT_GAP)
+ {
+ if (stat(file, &st) < 0) continue;
+ mt = st.st_mtime;
+ if (im->timestamp == mt)
+ ok++;
+ else continue;
+ }
+ else ok++;
+
+ laststat = t;
+ im->laststat = t;
return im;
}
/*
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs