diff --git a/ecdb/trunk/TODO b/ecdb/trunk/TODO index cfe84f2..e089977 100644 --- a/ecdb/trunk/TODO +++ b/ecdb/trunk/TODO @@ -1,3 +1,3 @@ -> Detect if the media in a drive has changed and update the drive info (dbus?). --> Make gstreamer dependancy optional +-> Make gstreamer dependancy optional DONE -> more graceful handling of errors diff --git a/ecdb/trunk/src/ecdb_burn.c b/ecdb/trunk/src/ecdb_burn.c index 8907b81..ab1e23f 100644 --- a/ecdb/trunk/src/ecdb_burn.c +++ b/ecdb/trunk/src/ecdb_burn.c @@ -93,14 +93,14 @@ ecdb_burn_project_destroy(Ecdb_Burn_Project *proj) FREE(proj->copywrite_id); FREE(proj->abstract_id); FREE(proj->biblio_id); - ecdb_project_destroy(ECDB_PROJ(proj)); + ecdb_project_destroy(ECDB_PROJECT(proj)); free(proj); } void ecdb_erase_project_destroy(Ecdb_Erase_Project *proj) { - ecdb_project_destroy(ECDB_PROJ(proj)); + ecdb_project_destroy(ECDB_PROJECT(proj)); free(proj); } @@ -182,7 +182,8 @@ ecdb_burn_project(Ecdb_Burn_Project *proj) pthread_create(&progress_update, NULL, _progress_update, proj); pthread_detach(progress_update); ecore_timer_add(0.5, _progress_gui_update, proj); - ecore_event_handler_add(ECDB_DRIVE_ACTION_FINISHED, ecdb_burn_finished, + ECDB_PROJECT(proj)->ev_handler = ecore_event_handler_add + (ECDB_DRIVE_ACTION_FINISHED, ecdb_burn_finished, data); return TRUE; @@ -282,7 +283,7 @@ _progress_gui_update(void *data) if (proj->stat == BURN_DRIVE_IDLE) { /* These don't enjoy being called before - * ecore_main_loop_bugin + * ecore_main_loop_begin */ //ecore_event_add(ECDB_DRIVE_ACTION_FINISHED, data, NULL, NULL); ecore_event_add(ECDB_DRIVE_ACTION_FINISHED, NULL, NULL, NULL); @@ -328,6 +329,8 @@ ecdb_burn_finished(void *data, int type, void *event) burn_drive_info_free(proj->proj->drive->tangible); printf("Burn Complete\n"); + ecore_event_handler_del(ECDB_PROJECT(proj)->ev_handler); + /* To be removed from here at some point */ Ecdb_Burn_Project *t; t = ECDB_BURN(proj->proj); @@ -335,5 +338,5 @@ ecdb_burn_finished(void *data, int type, void *event) FREE(t); FREE(proj); ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, NULL, NULL, NULL); - return FALSE; + return TRUE; } diff --git a/ecdb/trunk/src/ecdb_common.h b/ecdb/trunk/src/ecdb_common.h index 763d62a..3de753e 100644 --- a/ecdb/trunk/src/ecdb_common.h +++ b/ecdb/trunk/src/ecdb_common.h @@ -48,6 +48,7 @@ struct _Ecdb_Project_Info Ecdb_Drive_Info *drive; BurnProgress progress; BurnDriveStatus stat; + Ecore_Event_Handler *ev_handler; }; /* Typecast a pointer to an Ecdb_Source */ diff --git a/ecdb/trunk/src/ecdb_misc.c b/ecdb/trunk/src/ecdb_misc.c index 0c08e2f..8637697 100644 --- a/ecdb/trunk/src/ecdb_misc.c +++ b/ecdb/trunk/src/ecdb_misc.c @@ -27,7 +27,6 @@ ecdb_project_init(Ecdb_Project *proj) void ecdb_project_destroy(Ecdb_Project *proj) { - ecdb_lose_drive_info(proj); free(proj); } diff --git a/ecdb/trunk/src/ecdb_misc.h b/ecdb/trunk/src/ecdb_misc.h index c2dcaa0..c4c9417 100644 --- a/ecdb/trunk/src/ecdb_misc.h +++ b/ecdb/trunk/src/ecdb_misc.h @@ -3,7 +3,7 @@ Ecdb_Project *ecdb_project_new(void); int ecdb_project_init(Ecdb_Project *proj); -void ecdb_project_destroy(void); +void ecdb_project_destroy(Ecdb_Project *proj); int ecdb_shutdown(void *data, int type, void *event); void ecdb_burn_init(void); void ecdb_image_init(void);