Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_int_config_background.c e_int_config_theme.c e_main.c e_signals.c e_signals.h Log Message: 1. trap abort signals - glibc likes to abort these days on memory free errors. 2. fix bg selector to properly select the item to be selected (do it after listing them all), and add segmenting headers (And free path properly) =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_background.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- e_int_config_background.c 16 Mar 2006 09:42:27 -0000 1.42 +++ e_int_config_background.c 2 Apr 2006 04:18:18 -0000 1.43 @@ -279,6 +279,8 @@ Evas *evasbuf; const char *f; char *c; + int selnum = -1; + int i = 0; if (!il) return; @@ -289,6 +291,10 @@ eebuf = ecore_evas_buffer_new(1, 1); evasbuf = ecore_evas_get(eebuf); o = edje_object_add(evasbuf); + + e_widget_ilist_header_append(il, NULL, _("Theme")); + i++; + f = e_theme_edje_file_get("base/theme/backgrounds", "desktop/background"); c = strdup(f); if (edje_object_file_set(o, f, "desktop/background")) @@ -301,9 +307,9 @@ ic = e_thumb_evas_object_get(c, cfd->dia->win->evas, 48, 48, 1); e_widget_ilist_append(il, ic, "Theme Background", _ilist_cb_bg_selected, cfd, ""); + if (!e_config->desktop_default_background) selnum = i; + i++; } - if (!e_config->desktop_default_background) - e_widget_ilist_selected_set(il, 0); im = e_widget_preview_add(cfd->dia->win->evas, 320, 240); e_widget_preview_edje_set(im, f, "desktop/background"); @@ -319,52 +325,79 @@ for (bg = bg_dirs; bg; bg = bg->next) { E_Path_Dir *d; - + int detected; + char *bg_file; + Ecore_List *bgs; + char *homedir; + d = bg->data; - if (ecore_file_is_dir(d->dir)) + if (!ecore_file_is_dir(d->dir)) continue; + bgs = ecore_file_ls(d->dir); + if (!bgs) continue; + + detected = 0; + homedir = e_user_homedir_get(); + if (homedir) { - char *bg_file; - Ecore_List *bgs; - int i = 1; - - bgs = ecore_file_ls(d->dir); - if (!bgs) continue; - while ((bg_file = ecore_list_next(bgs))) + if (!strncmp(d->dir, homedir, strlen(homedir))) { - char full_path[4096]; - - snprintf(full_path, sizeof(full_path), "%s/%s", d->dir, bg_file); - if (ecore_file_is_dir(full_path)) continue; - if (!e_util_edje_collection_exists(full_path, "desktop/background")) continue; - - if (!e_thumb_exists(full_path)) - ic = e_thumb_generate_begin(full_path, 48, 48, evas, &ic, NULL, NULL); - else - ic = e_thumb_evas_object_get(full_path, evas, 48, 48, 1); - - e_widget_ilist_append(il, ic, ecore_file_strip_ext(bg_file), _ilist_cb_bg_selected, cfd, full_path); - if ((e_config->desktop_default_background) && - (!strcmp(e_config->desktop_default_background, full_path))) - { - e_widget_ilist_selected_set(il, i); - - evas_object_del(im); - im = e_widget_preview_add(cfd->dia->win->evas, 320, 240); - e_widget_preview_edje_set(im, e_config->desktop_default_background, "desktop/background"); -// im = e_widget_preview_add_from_object(cfd->dia->win->evas, o, 320, 240); -// e_widget_preview_object_set(im, e_thumb_evas_object_get(full_path, cfd->dia->win->evas, 320, 240, 1)); - } + e_widget_ilist_header_append(il, NULL, _("Personal")); i++; + detected = 1; + } + free(homedir); + } + if (!detected) + { + if (!strncmp(d->dir, e_prefix_data_get(), strlen(e_prefix_data_get()))) + { + e_widget_ilist_header_append(il, NULL, _("System")); + i++; + detected = 1; + } + } + if (!detected) + { + e_widget_ilist_header_append(il, NULL, _("Other")); + i++; + detected = 1; + } + while ((bg_file = ecore_list_next(bgs))) + { + char full_path[4096]; + + snprintf(full_path, sizeof(full_path), "%s/%s", d->dir, bg_file); + if (ecore_file_is_dir(full_path)) continue; + if (!e_util_edje_collection_exists(full_path, "desktop/background")) continue; + + if (!e_thumb_exists(full_path)) + ic = e_thumb_generate_begin(full_path, 48, 48, evas, &ic, NULL, NULL); + else + ic = e_thumb_evas_object_get(full_path, evas, 48, 48, 1); + + e_widget_ilist_append(il, ic, ecore_file_strip_ext(bg_file), _ilist_cb_bg_selected, cfd, full_path); + if ((e_config->desktop_default_background) && + (!strcmp(e_config->desktop_default_background, full_path))) + { + selnum = i; + + evas_object_del(im); + im = e_widget_preview_add(cfd->dia->win->evas, 320, 240); + e_widget_preview_edje_set(im, e_config->desktop_default_background, "desktop/background"); + // im = e_widget_preview_add_from_object(cfd->dia->win->evas, o, 320, 240); + // e_widget_preview_object_set(im, e_thumb_evas_object_get(full_path, cfd->dia->win->evas, 320, 240, 1)); } - free(bg_file); - ecore_list_destroy(bgs); + i++; } - free(d); + free(bg_file); + ecore_list_destroy(bgs); } evas_list_free(bg); - evas_list_free(bg_dirs); + if (bg_dirs) e_path_dir_list_free(bg_dirs); free(c); cfd->data = im; + if (selnum >= 0) + e_widget_ilist_selected_set(il, selnum); } void =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_theme.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- e_int_config_theme.c 2 Apr 2006 03:56:07 -0000 1.20 +++ e_int_config_theme.c 2 Apr 2006 04:18:18 -0000 1.21 @@ -151,20 +151,19 @@ { Ecore_List *themes; char *themefile; - E_Path_Dir *ep; + E_Path_Dir *d; int detected; - ep = l->data; - - if (!ecore_file_is_dir(ep->dir)) continue; - themes = ecore_file_ls(ep->dir); + d = l->data; + if (!ecore_file_is_dir(d->dir)) continue; + themes = ecore_file_ls(d->dir); if (!themes) continue; detected = 0; homedir = e_user_homedir_get(); if (homedir) { - if (!strncmp(ep->dir, homedir, strlen(homedir))) + if (!strncmp(d->dir, homedir, strlen(homedir))) { e_widget_ilist_header_append(il, NULL, _("Personal")); i++; @@ -174,7 +173,7 @@ } if (!detected) { - if (!strncmp(ep->dir, e_prefix_data_get(), strlen(e_prefix_data_get()))) + if (!strncmp(d->dir, e_prefix_data_get(), strlen(e_prefix_data_get()))) { e_widget_ilist_header_append(il, NULL, _("System")); i++; @@ -190,7 +189,7 @@ while ((themefile = ecore_list_next(themes))) { - snprintf(fulltheme, sizeof(fulltheme), "%s/%s", ep->dir, themefile); + snprintf(fulltheme, sizeof(fulltheme), "%s/%s", d->dir, themefile); if (ecore_file_is_dir(fulltheme)) continue; /* minimum theme requirements */ =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_main.c,v retrieving revision 1.160 retrieving revision 1.161 diff -u -3 -r1.160 -r1.161 --- e_main.c 14 Mar 2006 02:28:44 -0000 1.160 +++ e_main.c 2 Apr 2006 04:18:18 -0000 1.161 @@ -88,6 +88,11 @@ sigemptyset(&action.sa_mask); sigaction(SIGBUS, &action, NULL); + action.sa_sigaction = e_sigabrt_act; + action.sa_flags = SA_ONSTACK | SA_NODEFER | SA_RESETHAND | SA_SIGINFO; + sigemptyset(&action.sa_mask); + sigaction(SIGABRT, &action, NULL); + /* FIXME: this is the init code for letting e be relocatable. right now * its not used - so i want to see if it can reliably determine its exe * prefix =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_signals.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- e_signals.c 10 Jan 2006 04:23:43 -0000 1.11 +++ e_signals.c 2 Apr 2006 04:18:18 -0000 1.12 @@ -143,3 +143,28 @@ "etc."); exit(-11); } + +EAPI void +e_sigabrt_act(int x, siginfo_t *info, void *data) +{ + write(2, "**** ABORT ****\n", 21); + ecore_x_pointer_ungrab(); + ecore_x_keyboard_ungrab(); + ecore_x_ungrab(); + ecore_x_sync(); + e_alert_show("This is very bad. Enlightenment has recieved an abort.\n" + "This could be for many reasons - accessing memory not in\n" + "its available address space or unable to be paged in.\n" + "\n" + "You can gdb attach to this process now to try debug it\n" + "or you could exit, or just hit restart to try and get\n" + "your desktop back the way it was. This may not always\n" + "work perfectly, but it is the best we can do for now.\n" + "\n" + "Please help us debug this by compiling Enlightenment and\n" + "all its dependency libraries with gdb debugging enabled\n" + "and gdb attach to E when this happens and try figure out\n" + "what's going on and set us gdb backtraces, variable dumps\n" + "etc."); + exit(-11); +} =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_signals.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_signals.h 15 Jun 2005 05:06:45 -0000 1.3 +++ e_signals.h 2 Apr 2006 04:18:18 -0000 1.4 @@ -11,6 +11,7 @@ EAPI void e_sigill_act(int x, siginfo_t *info, void *data); EAPI void e_sigfpe_act(int x, siginfo_t *info, void *data); EAPI void e_sigbus_act(int x, siginfo_t *info, void *data); +EAPI void e_sigabrt_act(int x, siginfo_t *info, void *data); #endif #endif ------------------------------------------------------- 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