From: Enlightenment S. <no-...@en...> - 2010-07-13 21:18:31
|
Log: elsa: remove DISPLAY from config.h and clean some warning Author: yoz Date: 2010-07-13 14:18:24 -0700 (Tue, 13 Jul 2010) New Revision: 50234 Modified: trunk/PROTO/elsa/configure.ac trunk/PROTO/elsa/src/bin/elsa.c trunk/PROTO/elsa/src/bin/elsa_gui.c Modified: trunk/PROTO/elsa/configure.ac =================================================================== --- trunk/PROTO/elsa/configure.ac 2010-07-13 21:02:47 UTC (rev 50233) +++ trunk/PROTO/elsa/configure.ac 2010-07-13 21:18:24 UTC (rev 50234) @@ -35,10 +35,6 @@ # Set the localedir var for gettext AC_DEFINE([LOCALEDIR], ["/usr/share/locale/"], ["locales"]) -# Set DISPLAY in config.h. -display=":0.0" -AC_DEFINE_UNQUOTED(DISPLAY, "${display}", [Display to use]) - # Set USE_PAM in config.h. usepam="" AC_DEFINE_UNQUOTED(USE_PAM, "${use_pam}", [Use pam authentification]) Modified: trunk/PROTO/elsa/src/bin/elsa.c =================================================================== --- trunk/PROTO/elsa/src/bin/elsa.c 2010-07-13 21:02:47 UTC (rev 50233) +++ trunk/PROTO/elsa/src/bin/elsa.c 2010-07-13 21:18:24 UTC (rev 50234) @@ -3,6 +3,7 @@ #include "elsa.h" +#define ELSA_DISPLAY ":0.0" static Ecore_Event_Handler *_del_handler = NULL; static Ecore_Event_Handler *_exit_handler = NULL; @@ -54,18 +55,19 @@ sleep(1); } ecore_exe_hup(x_exec); - putenv("DISPLAY=:0.0"); + snprintf(buf, sizeof(buf), "DISPLAY=%s", dname); + putenv(buf); } static Eina_Bool _open_log() { - FILE *log; - log = fopen(elsa_config->logfile, "a"); - if (!log) { + FILE *elog; + elog = fopen(elsa_config->logfile, "a"); + if (!elog) { fprintf(stderr, PACKAGE": could not open logfile !!!\n"); return EINA_FALSE; } - fclose(log); + fclose(elog); freopen(elsa_config->logfile, "a", stdout); setvbuf(stdout, NULL, _IOLBF, BUFSIZ); freopen(elsa_config->logfile, "a", stderr); @@ -77,6 +79,7 @@ _close_log() { fclose(stderr); fclose(stdout); + return EINA_TRUE; } static void @@ -100,7 +103,7 @@ int main (int argc, char ** argv) { char tmp; - char *dname = DISPLAY; + char *dname = ELSA_DISPLAY; pid_t pid; while((tmp = getopt(argc, argv, "vhp:n:d?")) != EOF) { Modified: trunk/PROTO/elsa/src/bin/elsa_gui.c =================================================================== --- trunk/PROTO/elsa/src/bin/elsa_gui.c 2010-07-13 21:02:47 UTC (rev 50233) +++ trunk/PROTO/elsa/src/bin/elsa_gui.c 2010-07-13 21:18:24 UTC (rev 50234) @@ -10,10 +10,8 @@ static Evas_Object *_elsa_gui_theme_get(Evas_Object *win, const char *group); static void _elsa_gui_shutdown(void *data, Evas_Object *obj, void *event_info); -static void _elsa_gui_test_cb(void *data, Evas_Object *obj, const char *emission, const char *source); static Elsa_Gui *_gui; -static const char *_display = DISPLAY; static Evas_Object * _elsa_gui_theme_get (Evas_Object *win, const char *group) { @@ -33,11 +31,6 @@ } static void -_elsa_gui_test_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *emission, const char *source) { - fprintf(stderr, "%s: signal %s - %s\n", PACKAGE, emission, source); -} - -static void _elsa_gui_login_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { struct passwd *pwd; char *hostname = NULL; @@ -85,9 +78,6 @@ static void _elsa_gui_callback_add() { -/* edje_object_signal_callback_add(elm_layout_edje_get(_gui->edj), "*", "*", - _elsa_gui_test_cb, NULL); -*/ edje_object_signal_callback_add(elm_layout_edje_get(_gui->edj), "clicked", "login", _elsa_gui_login_cb, NULL); } @@ -107,8 +97,7 @@ #ifdef XNEST_DEBUG char *tmp = getenv("DISPLAY"); if (tmp && *tmp) { - _display = tmp; - fprintf(stderr, "Using display name %s", _display); + fprintf(stderr, PACKAGE": Using display name %s", tmp); } #endif |