Enlightenment CVS committal Author : titan Project : e17 Module : apps/ephoto
Dir : e17/apps/ephoto/src/bin Modified Files: ephoto_database.c ephoto_main.c Log Message: Change my mind on how I wanted to initialize the lists. =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_database.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ephoto_database.c 11 Mar 2007 09:08:16 -0000 1.6 +++ ephoto_database.c 11 Mar 2007 09:19:53 -0000 1.7 @@ -11,7 +11,7 @@ static int image_id, album_id; /*Ephoto databasing ecore global variables*/ -static Ecore_List *albums = NULL, *images_list = NULL, *image_ids = NULL; +static Ecore_List *albums, *images_list, *image_ids; /*Open the sqlite3 database. Create the database if it does not already exits.*/ sqlite3 *ephoto_db_init(void) @@ -20,6 +20,10 @@ char path2[PATH_MAX]; sqlite3 *db; + albums = ecore_list_new(); + images_list = ecore_dlist_new(); + image_ids = ecore_list_new(); + snprintf(path, PATH_MAX, "%s/.ephoto/.ephoto_database", getenv("HOME")); snprintf(path2, PATH_MAX, "%s/.ephoto", getenv("HOME")); @@ -218,7 +222,7 @@ } images_list = ecore_dlist_new(); image_ids = ecore_list_new(); - + snprintf(command, PATH_MAX, "SELECT id FROM albums WHERE name = '%s';", album); sqlite3_exec(db, command, get_album_id, 0, 0); snprintf(command, PATH_MAX, "SELECT image_id FROM album_images WHERE album_id = '%d';", album_id); =================================================================== RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ephoto_main.c 11 Mar 2007 09:10:42 -0000 1.10 +++ ephoto_main.c 11 Mar 2007 09:19:53 -0000 1.11 @@ -55,8 +55,8 @@ em = NULL; em = calloc(1, sizeof(Ephoto_Main)); - em->albums = NULL; - em->images = NULL; + em->albums = ecore_list_new(); + em->images = ecore_dlist_new(); em->win = ewl_window_new(); ewl_window_title_set(EWL_WINDOW(em->win), "Ephoto!"); @@ -189,7 +189,7 @@ album = data; } - if (em->images) + if (!ecore_list_is_empty(em->images)) { ecore_dlist_destroy(em->images); } ------------------------------------------------------------------------- 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 enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs