Enlightenment CVS committal Author : devilhorns Project : e_modules Module : screenshot
Dir : e_modules/screenshot Modified Files: e_mod_main.c Log Message: Allow setting dates in a filename (ie: myshot-2006-09.png). Formats can be gotten from man strftime. =================================================================== RCS file: /cvs/e/e_modules/screenshot/e_mod_main.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -3 -r1.61 -r1.62 --- e_mod_main.c 13 Aug 2006 21:53:41 -0000 1.61 +++ e_mod_main.c 16 Sep 2006 17:26:54 -0000 1.62 @@ -565,16 +565,23 @@ e_config_save_queue (); } - if ((!ci->filename) || (ci->filename == NULL)) + t = time (NULL); + loctime = localtime (&t); + + if ((!ci->filename) || (ci->filename == NULL)) { - t = time (NULL); - loctime = localtime (&t); strftime (buff, sizeof (buff), "%Y-%m-%d-%H%M%S", loctime); snprintf (buff, sizeof (buff), "%s.png", strdup (buff)); } else { - if (ecore_file_is_dir (ci->location)) + if (strstr(ci->filename, "%")) + { + strftime(buff, sizeof(buff), ci->filename, loctime); + if (!strrchr (ci->filename, '.')) + snprintf (buff, sizeof (buff), "%s.png", strdup(buff)); + } + else if (ecore_file_is_dir (ci->location)) { ext = ecore_file_strip_ext (ci->filename); fl = ecore_file_ls (ci->location); @@ -596,6 +603,7 @@ snprintf (buff, sizeof (buff), "%s%i.png", ext, c);; } } + printf("\n\nFilename: %s\n\n", buff); return strdup (buff); } ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs