Enlightenment CVS committal Author : kiwi Project : e_modules Module : devian
Dir : e_modules/devian/src/module Modified Files: dEvian.h e_mod_config.c e_mod_config.h e_mod_config_dialog.c e_mod_container_box.c e_mod_data_file.c e_mod_data_picture.c e_mod_data_picture.h e_mod_data_rss_parse.c e_mod_devian.c e_mod_source_file.c e_mod_source_picture.c Log Message: Work on picture and rss feature, fix a major bug, cleanings, version bump : * As requested, user can now remove dEvian's logo from the slideshow (Option in main configuration panel / advanced) * Major bug fixed : No more bad segv (with no white box) when trying to load more pictures than dEvian has ! And also on first creation of a picture source (same thing) :) * Fix leak in Rss * New warning indicator icon * Cleanings in code and debug messages * Make clean now works even if themes dont exists * Error message when trying to add a dEvian Log source, like its not stable yet * Version bump to 0.1.8 * Config version bump =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/dEvian.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- dEvian.h 5 Apr 2006 17:48:48 -0000 1.2 +++ dEvian.h 14 Apr 2006 09:09:38 -0000 1.3 @@ -58,48 +58,47 @@ /* Debuging things */ #ifdef DEBUG_MAIN -# define DMAIN(x) do {printf(__FILE__ ":%d: ", __LINE__); printf x; printf("\n"); fflush(stdout);} while (0) +# define DMAIN(x) do {printf("MAIN - %s:%d: ", __FILE__, __LINE__); printf x; printf("\n"); fflush(stdout);} while (0) #else # define DMAIN(x) ((void) 0) #endif #ifdef DEBUG_POPUP_WARN -# define DPOPW(x) do {printf(__FILE__ ":%d: POPW : ", __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) +# define DPOPW(x) do {printf("POPW - %s:%d: ", __FILE__, __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) #else # define DPOPW(x) ((void) 0) #endif #ifdef DEBUG_SOURCE -# define DSOURCE(x) do {printf(__FILE__ ":%d: ", __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) +# define DSOURCE(x) do {printf("SOURCE - %s:%d: ", __FILE__, __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) #else # define DSOURCE(x) ((void) 0) #endif #ifdef DEBUG_CONTAINER -# define DCONTAINER(x) do {printf(__FILE__ ":%d: ", __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) +# define DCONTAINER(x) do {printf("CONTAINER - %s:%d: ", __FILE__, __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) #else # define DCONTAINER(x) ((void) 0) #endif #ifdef DEBUG_DATA -# define DDATA(x) do {printf(__FILE__ ":%d: ", __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) +# define DDATA(x) do {printf("DATA - %s:%d: ", __FILE__, __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) #else # define DDATA(x) ((void) 0) #endif #ifdef DEBUG_DATA_CACHE -# define DDATAC(x) do {printf(__FILE__ ":%d: CACHE ", __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) +# define DDATAC(x) do {printf("DATA_CACHE %s:%d: ", __FILE__, __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) #else # define DDATAC(x) ((void) 0) #endif #ifdef DEBUG_DATA_RSS -# define DDATARSS(x) do {printf(__FILE__ ":%d: RSS ", __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) +# define DDATARSS(x) do {printf("DATA_RSS %s:%d: ", __FILE__, __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) #else # define DDATARSS(x) ((void) 0) #endif #ifdef DEBUG_DATA_RSS_PARSER -# define DDATARSSP(x) do {printf(__FILE__ ":%d: RSS PARSE ", __LINE__); p\ -rintf x; printf ("\n"); fflush(stdout);} while (0) +# define DDATARSSP(x) do {printf("DATA_RSS_PARSE - %s:%d: ", __FILE__, __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) #else # define DDATARSSP(x) ((void) 0) #endif #ifdef DEBUG_DATA_FILE -# define DDATAFILE(x) do {printf(__FILE__ ":%d: FILE ", __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) +# define DDATAFILE(x) do {printf("DATA_FILE - %s:%d: ", __FILE__, __LINE__); printf x; printf ("\n"); fflush(stdout);} while (0) #else # define DDATAFILE(x) ((void) 0) #endif =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_config.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_mod_config.c 5 Apr 2006 17:48:48 -0000 1.2 +++ e_mod_config.c 14 Apr 2006 09:09:38 -0000 1.3 @@ -58,7 +58,7 @@ "has been upgraded<br>" "Your settings were removed<br>" "Sorry for the inconvenience<br><br>" "(%d -> %d)"), cfg_main->conf_version, CONFIG_VERSION); - e_module_dialog_show(_(MODULE_NAME "Module"), buf); + e_module_dialog_show(_(MODULE_NAME " Module version " MODULE_VERSION), buf); cfg_main = NULL; } @@ -74,7 +74,7 @@ "has been downgraded<br>" "Your settings were removed<br>" "Sorry for the inconvenience<br><br>" "(%d ->%d)"), cfg_main->conf_version, CONFIG_VERSION); - e_module_dialog_show(_(MODULE_NAME " Module"), buf); + e_module_dialog_show(_(MODULE_NAME " Module version " MODULE_VERSION), buf); cfg_main = NULL; } } @@ -229,6 +229,7 @@ cfg_main->sources_picture_data_import_recursive = 0; cfg_main->sources_picture_default_location = DATA_PICTURE_LOCAL; cfg_main->sources_picture_set_bg_purge = SOURCE_PICTURE_SET_BG_PURGE_DEFAULT; + cfg_main->sources_picture_show_devian_pics = DATA_PICTURE_SHOW_DEVIAN_PICS_DEFAULT; #endif #ifdef HAVE_RSS cfg_main->sources_rss_timer_s = SOURCE_RSS_UPDATE_RATE_DEFAULT; @@ -509,6 +510,7 @@ E_CONFIG_VAL(D, T, sources_picture_data_import_recursive, INT); E_CONFIG_VAL(D, T, sources_picture_default_location, INT); E_CONFIG_VAL(D, T, sources_picture_set_bg_purge, INT); + E_CONFIG_VAL(D, T, sources_picture_show_devian_pics, INT); #endif #ifdef HAVE_RSS E_CONFIG_VAL(D, T, sources_rss_timer_s, INT); =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_config.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_mod_config.h 5 Apr 2006 17:48:48 -0000 1.2 +++ e_mod_config.h 14 Apr 2006 09:09:38 -0000 1.3 @@ -8,10 +8,10 @@ #define E_MOD_CONFIG_H_INCLUDED #ifdef HAVE_ALL -#define CONFIG_VERSION 48 +#define CONFIG_VERSION 49 #else #ifdef HAVE_PICTURE -#define CONFIG_VERSION 3 +#define CONFIG_VERSION 4 #else #ifdef HAVE_RSS #define CONFIG_VERSION 4 @@ -50,6 +50,7 @@ int sources_picture_data_import_thumbs_warn; int sources_picture_default_location; int sources_picture_set_bg_purge; + int sources_picture_show_devian_pics; #endif #ifdef HAVE_RSS int sources_rss_timer_s; =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_config_dialog.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_mod_config_dialog.c 5 Apr 2006 17:48:48 -0000 1.2 +++ e_mod_config_dialog.c 14 Apr 2006 09:09:38 -0000 1.3 @@ -50,6 +50,7 @@ #ifdef HAVE_PICTURE int data_picture_thumb_default_size; int sources_picture_set_bg_purge; + int sources_picture_show_devian_pics; #endif #ifdef HAVE_RSS int sources_rss_timer_s; @@ -157,6 +158,7 @@ #ifdef HAVE_PICTURE cfdata->data_picture_thumb_default_size = conf->data_picture_thumb_default_size; cfdata->sources_picture_set_bg_purge = conf->sources_picture_set_bg_purge; + cfdata->sources_picture_show_devian_pics = conf->sources_picture_show_devian_pics; #endif #ifdef HAVE_FILE cfdata->sources_file_nb_lines_ini = conf->sources_file_nb_lines_ini; @@ -330,6 +332,7 @@ #ifdef HAVE_PICTURE DEVIANM->conf->data_picture_thumb_default_size = cfdata->data_picture_thumb_default_size; DEVIANM->conf->sources_picture_set_bg_purge = cfdata->sources_picture_set_bg_purge; + DEVIANM->conf->sources_picture_show_devian_pics = cfdata->sources_picture_show_devian_pics; #endif #ifdef HAVE_FILE DEVIANM->conf->sources_file_nb_lines_ini = cfdata->sources_file_nb_lines_ini; @@ -543,6 +546,8 @@ e_widget_frametable_object_append(of, ob, 1, 3, 1, 1, 1, 0, 1, 0); ob = e_widget_check_add(evas, _("Remove created .e/e/backgrounds/"), &(cfdata->sources_picture_set_bg_purge)); e_widget_frametable_object_append(of, ob, 0, 4, 2, 1, 1, 1, 1, 1); + ob = e_widget_check_add(evas, _("Show dEvian's logo in slideshow"), &(cfdata->sources_picture_show_devian_pics)); + e_widget_frametable_object_append(of, ob, 0, 5, 2, 1, 1, 1, 1, 1); e_widget_table_object_append(o, of, 1, 1, 1, 1, 1, 1, 1, 1); #endif #ifdef HAVE_FILE =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_container_box.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_mod_container_box.c 11 Apr 2006 11:18:44 -0000 1.3 +++ e_mod_container_box.c 14 Apr 2006 09:09:39 -0000 1.4 @@ -396,9 +396,7 @@ char *source_name; int w, h; - DEVIANF(source_evas_object_get) (container->devian, &source0, &source1); - - if (!source0 && !source1) + if (!DEVIANF(source_evas_object_get) (container->devian, &source0, &source1)) return 0; if (container->in_transition) @@ -997,7 +995,8 @@ return; } - DEVIANF(source_evas_object_get) (devian, &source0, &source1); + if (!DEVIANF(source_evas_object_get) (devian, &source0, &source1)) + return 0; if (!strcmp(emission, "source_transition_0-1_end")) { =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_data_file.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_mod_data_file.c 6 Apr 2006 22:40:08 -0000 1.3 +++ e_mod_data_file.c 14 Apr 2006 09:09:39 -0000 1.4 @@ -150,6 +150,7 @@ p1 = *buffer; size_left = *size; + /* Quick replace for unused chars ...CHANGE, use them ! */ while (p1 < (*buffer + *size)) { if (*p1 == 0xd) @@ -161,10 +162,10 @@ p1 = *buffer; - while ((p2 = memchr(p1, '\n', size_left))) + while ( (size_left > 0) && + (p2 = memchr(p1, '\n', size_left)) ) { /* Replace by <br> */ - *size = *size + 3; *buffer = realloc(*buffer, *size); memmove(p2 + 3, p2, strlen(p2) + 1); @@ -175,19 +176,12 @@ /* Add the position to the list */ pos = E_NEW(int, 1); - *pos = p2 - *buffer; ecore_list_append(lines, pos); - /* - * p1 = p2+1; - * size_left = *size - (*pos+1); - */ + /* Go to next char */ p1 = p2 + 4; size_left = *size - (*pos + 4); - - if (size_left > 0) - break; }; return lines; =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_data_picture.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_mod_data_picture.c 5 Apr 2006 17:48:48 -0000 1.2 +++ e_mod_data_picture.c 14 Apr 2006 09:09:39 -0000 1.3 @@ -40,7 +40,8 @@ list = DEVIANM->picture_list_local; /* Load pictures */ - _picture_list_local_add_dir(e_module_dir_get(DEVIANM->module), 0); + if (DEVIANM->conf->sources_picture_show_devian_pics) + _picture_list_local_add_dir(e_module_dir_get(DEVIANM->module), 0); _picture_list_local_add_dir(DEVIANM->conf->sources_picture_data_import_dir, DEVIANM->conf->sources_picture_data_import_recursive); @@ -229,7 +230,7 @@ while (picture->source || picture->delete); /* Add it to the cache if wasnt */ - if (!picture->picture) + if (!picture->picture) if (!_picture_cache_add_picture(picture)) return NULL; @@ -252,7 +253,7 @@ picture = evas_list_nth(cache->pictures, cache->pos); cache->pos++; if (cache->pos > (evas_list_count(cache->pictures) - 1)) - cache->pos = -1; // Overflow -> no more pictures avalaible ! + cache->pos = -1; /* Overflow -> no more pictures avalaible ! */ /* If picture isnt good, retry */ if (picture->source || picture->delete) return DEVIANF(data_picture_cache_attach) (source, edje_part, 0); @@ -265,7 +266,7 @@ } /* Attach the picture to the source's historic - * and attach the source to the picture histo's list */ + * and attach the source to the picture histo's list */ DEVIANF(source_picture_histo_picture_attach) (source, picture); } @@ -276,7 +277,7 @@ else source->picture1 = picture; cache->nb_attached++; - + DDATAC(("attach ok (%s, %p), pos: %d", picture->picture_description->name, picture, cache->pos)); return picture; @@ -306,7 +307,9 @@ if (part && (source->picture1)) picture = source->picture1; else - printf("BAD BAD BAD in cache detach\n"); + { + DDATAC(("BAD BAD BAD in cache detach")); + } } if (!picture) @@ -591,6 +594,8 @@ cache = DEVIANM->picture_cache; + DDATAC(("Going to try to attach unused picture")); + if (!evas_list_count(cache->pictures)) return NULL; if (!cache->pos) @@ -612,8 +617,11 @@ { picture = evas_list_data(l); /* Current picture ? */ - if (!picture->source && !picture->delete) - return picture; + if (!picture->source && !picture->delete && picture->thumbed) + { + DDATAC(("Picture found ! %s", picture->picture_description->name)); + return picture; + } l = evas_list_next(l); if (cache->pos == -1) @@ -813,8 +821,6 @@ * on next picture change */ if (!force_now) { - //if (picture->cached) - //_picture_cache_del_picture(picture); picture->delete = 1; return 1; } =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_data_picture.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_mod_data_picture.h 5 Apr 2006 17:48:48 -0000 1.2 +++ e_mod_data_picture.h 14 Apr 2006 09:09:39 -0000 1.3 @@ -18,6 +18,7 @@ #define DATA_PICTURE_INFOS_LEN 100 #define DATA_PICTURE_THUMB_SIZE_DEFAULT 300 #define DATA_PICTURE_CACHE_SIZE_DEFAULT 2 +#define DATA_PICTURE_SHOW_DEVIAN_PICS_DEFAULT 1 struct _Picture_List_Local { =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_data_rss_parse.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_mod_data_rss_parse.c 11 Apr 2006 11:18:44 -0000 1.3 +++ e_mod_data_rss_parse.c 14 Apr 2006 09:09:39 -0000 1.4 @@ -23,28 +23,17 @@ #define PARSE_ITEM_DATE_20 5 #define PARSE_ARTICLE_FAILS() \ -do { \ -if (article->title) \ - evas_stringshare_del(article->title); \ -if (article->url) \ - evas_stringshare_del(article->url); \ -if (article->description) \ - evas_stringshare_del(article->description); \ -if (article->date) \ - evas_stringshare_del(article->date); \ -if (article->date_simple) \ - evas_stringshare_del(article->date_simple); \ -return NULL; \ -} while (0) +DEVIANF(data_rss_article_free) (article); \ +return NULL; #define PARSE_INFOS_FAILS() \ -do { \ if (name) \ evas_stringshare_del(name); \ +if (link) \ + evas_stringshare_del(link); \ if (description) \ evas_stringshare_del(description); \ -return 0; \ -} while (0) +return 0; static char *_parse_item(char *buf, const char **text, int type); static char *_parse_item_clean(char *buf, int size, int type); @@ -53,6 +42,7 @@ static char *_parse_go_begin_meta(char *buf); static char *_parse_go_end_meta(char *buf); + /* PUBLIC FUNCTIONS */ /** @@ -215,7 +205,9 @@ { DDATARSSP(("detected title")); if (!(tmp = _parse_item(buf, &article->title, PARSE_ITEM_TITLE))) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } } else { @@ -223,7 +215,9 @@ { DDATARSSP(("detected link")); if (!(tmp = _parse_item(buf, &article->url, PARSE_ITEM_URL))) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } } else { @@ -231,7 +225,9 @@ { DDATARSSP(("detected description")); if (!(tmp = _parse_item(buf, &article->description, PARSE_ITEM_DESC))) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } } else { @@ -246,12 +242,16 @@ /* Parse it one time ->date and one time ->date_simple */ DDATARSSP(("detected pubdate")); if (!(tmp = _parse_item(buf, &article->date, PARSE_ITEM_TITLE))) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } else { buf = buf_sav; if (!(tmp = _parse_item(buf, &article->date_simple, PARSE_ITEM_DATE_10))) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } } } break; @@ -263,12 +263,16 @@ /* Parse it one time ->date and one time ->date_simple */ DDATARSSP(("detected pubdate")); if (!(tmp = _parse_item(buf, &article->date, PARSE_ITEM_TITLE))) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } else { buf = buf_sav; if (!(tmp = _parse_item(buf, &article->date_simple, PARSE_ITEM_DATE_20))) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } } } break; @@ -277,12 +281,12 @@ if (!tmp) { /* We didnt found what is the meta ? The we jump over it :) - * Before, test if where not going to crash after jump =) - * -> Test html meta wich dont work in pair with a close meta */ - //... + * Before, test if where not going to crash after jump =) */ DDATARSSP(("unknow meta (%8.8s), skip", buf)); if (!(tmp = _parse_go_end_meta(buf))) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } } } } @@ -299,7 +303,9 @@ /* Check prematurate end of article, missing data * keep it anyway */ if (!*(buf + 1)) - PARSE_ARTICLE_FAILS(); + { + PARSE_ARTICLE_FAILS(); + } if (*(buf + 1) == '/') break; } =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_devian.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_mod_devian.c 5 Apr 2006 17:48:48 -0000 1.2 +++ e_mod_devian.c 14 Apr 2006 09:09:39 -0000 1.3 @@ -51,7 +51,7 @@ } } - DMAIN(("init_devian OK\n")); + DMAIN(("init_devian OK")); return 1; } @@ -442,7 +442,7 @@ e_module_dialog_show(_(MODULE_NAME " Module Error"), buf); return NULL; } - DMAIN(("Edje loaded %s group %s\n", path, part)); + DMAIN(("Edje loaded %s group %s", path, part)); return theme; } =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_source_file.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_mod_source_file.c 6 Apr 2006 22:40:08 -0000 1.3 +++ e_mod_source_file.c 14 Apr 2006 09:09:39 -0000 1.4 @@ -13,7 +13,17 @@ { Source_File *source; - return 0; /* SOURCE_FILE IS NOT STABLE YET */ + /* SOURCE_FILE IS NOT STABLE YET */ + { + char buf[4096]; + + snprintf(buf, sizeof(buf), + _("<hilight>dEvian's Log feature isn't stable yet !</hilight><br><br>" + "This feature is disabled for the moment")); + e_module_dialog_show(_(MODULE_NAME " Module error"), buf); + return 0; + } + /* SOURCE_FILE IS NOT STABLE YET */ DSOURCE(("Source file creation START")); =================================================================== RCS file: /cvs/e/e_modules/devian/src/module/e_mod_source_picture.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_mod_source_picture.c 11 Apr 2006 11:18:44 -0000 1.3 +++ e_mod_source_picture.c 14 Apr 2006 09:09:39 -0000 1.4 @@ -58,7 +58,7 @@ /* Attach picture */ DEVIANF(source_picture_change) (devian, 0); - DSOURCE(("Source picture creation OK\n")); + DSOURCE(("Source picture creation OK")); return 0; } @@ -108,7 +108,10 @@ option = -1; if (!DEVIANF(data_picture_cache_attach) (source, !old_part, option)) - return 0; + { + DSOURCE(("Cant attach picture to part !old_part !")); + return 0; + } if (source->devian->container) { ------------------------------------------------------- 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