Use E_FREE for things created with E_NEW.
Formatting & Whitespace Removal SVN revision: 41442
This commit is contained in:
parent
0df3f4e2d9
commit
b0a07a8ac6
|
@ -37,9 +37,7 @@ struct _E_Config_Dialog_Data
|
|||
Ecore_Exe_Event_Data *error;
|
||||
Ecore_Exe_Event_Data *read;
|
||||
|
||||
char *label;
|
||||
char *exit;
|
||||
char *signal;
|
||||
char *label, *exit, *signal;
|
||||
};
|
||||
|
||||
/* local subsystem functions */
|
||||
|
@ -90,7 +88,8 @@ e_exec_shutdown(void)
|
|||
e_util_env_set("E_STARTUP_ID", buf);
|
||||
|
||||
if (_e_exec_exit_handler) ecore_event_handler_del(_e_exec_exit_handler);
|
||||
if (_e_exec_border_add_handler) ecore_event_handler_del(_e_exec_border_add_handler);
|
||||
if (_e_exec_border_add_handler)
|
||||
ecore_event_handler_del(_e_exec_border_add_handler);
|
||||
eina_hash_free(e_exec_instances);
|
||||
eina_list_free(e_exec_start_pending);
|
||||
return 1;
|
||||
|
@ -119,7 +118,8 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
|
|||
if (exec)
|
||||
inst = _e_exec_cb_exec(launch, NULL, strdup(exec), 0);
|
||||
else
|
||||
inst = efreet_desktop_command_get(desktop, files, _e_exec_cb_exec, launch);
|
||||
inst =
|
||||
efreet_desktop_command_get(desktop, files, _e_exec_cb_exec, launch);
|
||||
}
|
||||
else
|
||||
inst = _e_exec_cb_exec(launch, NULL, strdup(exec), 0);
|
||||
|
@ -158,6 +158,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
|
|||
if (startup_id == 0)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
p = getenv("E_STARTUP_ID");
|
||||
if (p) startup_id = atoi(p);
|
||||
e_util_env_set("E_STARTUP_ID", NULL);
|
||||
|
@ -242,7 +243,8 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
|
|||
inst->exe = exe;
|
||||
inst->startup_id = startup_id;
|
||||
inst->launch_time = ecore_time_get();
|
||||
inst->expire_timer = ecore_timer_add(10.0, _e_exec_cb_expire_timer, inst);
|
||||
inst->expire_timer = ecore_timer_add(10.0,
|
||||
_e_exec_cb_expire_timer, inst);
|
||||
|
||||
l = eina_hash_find(e_exec_instances, desktop->orig_path);
|
||||
if (l)
|
||||
|
@ -333,8 +335,7 @@ _e_exec_cb_exit(void *data, int type, void *event)
|
|||
{
|
||||
/* filter out common exits via signals - int/term/quit. not really
|
||||
* worth popping up a dialog for */
|
||||
if (!
|
||||
((ev->signalled) &&
|
||||
if (!((ev->signalled) &&
|
||||
((ev->exit_signal == SIGINT) ||
|
||||
(ev->exit_signal == SIGQUIT) ||
|
||||
(ev->exit_signal == SIGTERM)))
|
||||
|
@ -400,7 +401,7 @@ _e_exec_error_dialog(Efreet_Desktop *desktop, const char *exec, Ecore_Exe_Event_
|
|||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
||||
if (!cfdata)
|
||||
{
|
||||
free(v);
|
||||
E_FREE(v);
|
||||
return;
|
||||
}
|
||||
cfdata->desktop = desktop;
|
||||
|
@ -435,14 +436,16 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
if ((cfdata->event.exited) && (!cfdata->exit))
|
||||
{
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("An exit code of %i was returned from %s."), cfdata->event.exit_code, cfdata->exec);
|
||||
_("An exit code of %i was returned from %s."),
|
||||
cfdata->event.exit_code, cfdata->exec);
|
||||
cfdata->exit = strdup(buf);
|
||||
}
|
||||
if ((cfdata->event.signalled) && (!cfdata->signal))
|
||||
{
|
||||
if (cfdata->event.exit_signal == SIGINT)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by an Interrupt Signal."), cfdata->desktop->exec);
|
||||
_("%s was interrupted by an Interrupt Signal."),
|
||||
cfdata->desktop->exec);
|
||||
else if (cfdata->event.exit_signal == SIGQUIT)
|
||||
snprintf(buf, sizeof(buf), _("%s was interrupted by a Quit Signal."),
|
||||
cfdata->exec);
|
||||
|
@ -451,19 +454,23 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
_("%s was interrupted by an Abort Signal."), cfdata->exec);
|
||||
else if (cfdata->event.exit_signal == SIGFPE)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Floating Point Error."), cfdata->exec);
|
||||
_("%s was interrupted by a Floating Point Error."),
|
||||
cfdata->exec);
|
||||
else if (cfdata->event.exit_signal == SIGKILL)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by an Uninterruptable Kill Signal."), cfdata->exec);
|
||||
_("%s was interrupted by an Uninterruptable Kill Signal."),
|
||||
cfdata->exec);
|
||||
else if (cfdata->event.exit_signal == SIGSEGV)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Segmentation Fault."), cfdata->exec);
|
||||
_("%s was interrupted by a Segmentation Fault."),
|
||||
cfdata->exec);
|
||||
else if (cfdata->event.exit_signal == SIGPIPE)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Broken Pipe."), cfdata->exec);
|
||||
else if (cfdata->event.exit_signal == SIGTERM)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Termination Signal."), cfdata->exec);
|
||||
_("%s was interrupted by a Termination Signal."),
|
||||
cfdata->exec);
|
||||
else if (cfdata->event.exit_signal == SIGBUS)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Bus Error."), cfdata->exec);
|
||||
|
@ -517,18 +524,16 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
E_FREE(cfdata->signal);
|
||||
E_FREE(cfdata->exit);
|
||||
E_FREE(cfdata->label);
|
||||
|
||||
free(cfdata);
|
||||
E_FREE(cfdata);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *lines)
|
||||
{
|
||||
int i;
|
||||
Evas_Object *obj, *os;
|
||||
char *text;
|
||||
char *trunc_note = _("***The remaining output has been truncated. Save the output to view.***\n");
|
||||
int tlen, max_lines;
|
||||
int tlen, max_lines, i;
|
||||
|
||||
os = e_widget_framelist_add(evas, _(title), 0);
|
||||
|
||||
|
@ -561,8 +566,7 @@ _dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *li
|
|||
}
|
||||
|
||||
/* Append the warning about truncated output. */
|
||||
if (lines[max_lines].line != NULL)
|
||||
strcat(text, trunc_note);
|
||||
if (lines[max_lines].line != NULL) strcat(text, trunc_note);
|
||||
|
||||
e_widget_textblock_plain_set(obj, text);
|
||||
}
|
||||
|
@ -587,11 +591,11 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
ob = e_widget_label_add(evas, cfdata->label);
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
|
||||
if (cfdata->error)
|
||||
error_length = cfdata->error->size;
|
||||
if (cfdata->error) error_length = cfdata->error->size;
|
||||
if (error_length)
|
||||
{
|
||||
os = _dialog_scrolltext_create(evas, _("Error Logs"), cfdata->error->lines);
|
||||
os = _dialog_scrolltext_create(evas, _("Error Logs"),
|
||||
cfdata->error->lines);
|
||||
e_widget_list_object_append(o, os, 1, 1, 0.5);
|
||||
}
|
||||
else
|
||||
|
@ -644,12 +648,12 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
}
|
||||
|
||||
if (cfdata->read)
|
||||
read_length = cfdata->read->size;
|
||||
if (cfdata->read) read_length = cfdata->read->size;
|
||||
|
||||
if (read_length)
|
||||
{
|
||||
of = _dialog_scrolltext_create(evas, _("Output Data"), cfdata->read->lines);
|
||||
of = _dialog_scrolltext_create(evas, _("Output Data"),
|
||||
cfdata->read->lines);
|
||||
/* FIXME: Add stdout "start". */
|
||||
/* FIXME: Add stdout "end". */
|
||||
}
|
||||
|
@ -661,11 +665,11 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
}
|
||||
e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||
|
||||
if (cfdata->error)
|
||||
error_length = cfdata->error->size;
|
||||
if (cfdata->error) error_length = cfdata->error->size;
|
||||
if (error_length)
|
||||
{
|
||||
of = _dialog_scrolltext_create(evas, _("Error Logs"), cfdata->error->lines);
|
||||
of = _dialog_scrolltext_create(evas, _("Error Logs"),
|
||||
cfdata->error->lines);
|
||||
/* FIXME: Add stderr "start". */
|
||||
/* FIXME: Add stderr "end". */
|
||||
}
|
||||
|
@ -679,7 +683,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
|
||||
e_widget_list_object_append(o, ot, 1, 1, 0.5);
|
||||
|
||||
ob = e_widget_button_add(evas, _("Save This Message"), "system-run", _dialog_save_cb, NULL, cfdata);
|
||||
ob = e_widget_button_add(evas, _("Save This Message"), "system-run",
|
||||
_dialog_save_cb, NULL, cfdata);
|
||||
e_widget_list_object_append(o, ob, 0, 0, 0.5);
|
||||
|
||||
snprintf(buf, sizeof(buf), _("This error log will be saved as %s/%s.log"),
|
||||
|
@ -710,17 +715,18 @@ _dialog_save_cb(void *data, void *data2)
|
|||
|
||||
if (cfdata->exit)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "Error Information:\n\t%s\n\n", cfdata->exit);
|
||||
snprintf(buffer, sizeof(buffer), "Error Information:\n\t%s\n\n",
|
||||
cfdata->exit);
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), f);
|
||||
}
|
||||
if (cfdata->signal)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "Error Signal Information:\n\t%s\n\n", cfdata->signal);
|
||||
snprintf(buffer, sizeof(buffer), "Error Signal Information:\n\t%s\n\n",
|
||||
cfdata->signal);
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), f);
|
||||
}
|
||||
|
||||
if (cfdata->read)
|
||||
read_length = cfdata->read->size;
|
||||
if (cfdata->read) read_length = cfdata->read->size;
|
||||
|
||||
if (read_length)
|
||||
{
|
||||
|
@ -749,8 +755,7 @@ _dialog_save_cb(void *data, void *data2)
|
|||
|
||||
/* Reusing this var */
|
||||
read_length = 0;
|
||||
if (cfdata->error)
|
||||
read_length = cfdata->error->size;
|
||||
if (cfdata->error) read_length = cfdata->error->size;
|
||||
|
||||
if (read_length)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue