Enlightenment CVS committal Author : titansoccer15 Project : e17 Module : proto
Dir : e17/proto/ephoto/src Modified Files: ephoto.c ephoto_browsing.c Log Message: Image databasing is set up now. Default directory is now ~/ephoto_images. ephoto_images will contain all images that you select from other directorys. =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ephoto.c 21 Feb 2006 22:26:05 -0000 1.2 +++ ephoto.c 24 Feb 2006 21:25:55 -0000 1.3 @@ -15,6 +15,8 @@ int audiolen; int slidenum; char *audios; +char tempdb[PATH_MAX]; +char db[PATH_MAX]; /*****************/ int main(int argc, char **argv) @@ -33,8 +35,13 @@ /****Setup the list/hashes ephoto uses****/ m->imagelist = ecore_dlist_new(); /*****************************************/ - /****Get home directory****/ + /****Get db directory****/ char *home = getenv("HOME"); + snprintf(tempdb, PATH_MAX, "%s/ephoto_images", home); + if ( !ecore_file_is_dir(tempdb) ) { + ecore_file_mkdir(tempdb); + } + snprintf(db, PATH_MAX, "%s", tempdb); /**************************/ /****Setup the layout****/ m->win = ewl_window_new(); @@ -65,7 +72,7 @@ ewl_widget_show(m->images); m->directory = ewl_entry_new(); - ewl_text_text_set(EWL_TEXT(m->directory), home); + ewl_text_text_set(EWL_TEXT(m->directory), db); ewl_object_alignment_set(EWL_OBJECT(m->directory), EWL_FLAG_ALIGN_CENTER); ewl_container_child_append(EWL_CONTAINER(m->images), m->directory); ewl_callback_append(m->directory, EWL_CALLBACK_VALUE_CHANGED, populatei_cb, NULL); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto_browsing.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ephoto_browsing.c 23 Feb 2006 05:31:54 -0000 1.6 +++ ephoto_browsing.c 24 Feb 2006 21:25:55 -0000 1.7 @@ -430,6 +430,10 @@ /****Setup variables for adding images to the iconbox****/ const char *pathi; const char *name; + char *home; + char imagedb[PATH_MAX]; + char tempcheck[PATH_MAX]; + char equiv[PATH_MAX]; /********************************************************/ pathi = ewl_widget_name_get(w); name = basename(pathi); @@ -443,6 +447,17 @@ ecore_dlist_append(m->imagelist, strdup(pathi)); slidenum++; + + home = getenv("HOME"); + snprintf(imagedb, PATH_MAX, "%s/ephoto_images", home); + printf("%s\n", imagedb); + snprintf(tempcheck, PATH_MAX, "%s/%s", imagedb, name); + printf("%s\n", tempcheck); + if ( !ecore_file_exists(tempcheck) ) { + snprintf(equiv, PATH_MAX, "%s", pathi); + printf("%s\n", equiv); + ecore_file_cp(equiv, tempcheck); + } /**********************************************************/ /****Enable the slideshow and presentation buttons so we can get to work****/ ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs