Fix a bunch of mistakes I made before.

This commit is contained in:
Jaime Thomas 2009-02-17 22:48:11 +00:00
parent 894f4d59f5
commit 2c8a5fb139
11 changed files with 183 additions and 175 deletions

View File

@ -204,18 +204,18 @@ ecdb_burn_progress_handler(void *data, void *buffer, unsigned int nbyte)
return; return;
} }
switch (proj->type) switch (bdata->proj->type)
{ {
case ECDB_AUDIO_PROJECT: case ECDB_AUDIO_PROJECT:
swallow = page->audio; swallow = bdata->page->audio;
break; break;
case: ECDB_DATA_PROJECT: case ECDB_DATA_PROJECT:
swallow = page->data; swallow = bdata->page->data;
break; break;
case: ECDB_IMAGE_PROJECT: case ECDB_IMAGE_PROJECT:
swallow = page->image; swallow = bdata->page->image;
break; break;
default: default:
@ -270,7 +270,7 @@ ecdb_burn_finished(void *data, int type, void *event)
switch (proj->proj->type) switch (proj->proj->type)
{ {
case ECDB_AUDIO_PROJECT: case ECDB_AUDIO_PROJECT:
print("How in the world did you get here?\n"); printf("How in the world did you get here?\n");
//ecdb_burn_audio_cleanup(proj->page); //ecdb_burn_audio_cleanup(proj->page);
break; break;

View File

@ -689,7 +689,7 @@ ecdb_burn_data_cleanup(Ecdb_Page *page)
{ {
Ewl_Widget *filelist; Ewl_Widget *filelist;
Ecdb_Source *src; Ecdb_Source *src;
Ecdb_Burn_Data_Project *proj; Ecdb_Data_Project *proj;
int i; int i;
if (!page) if (!page)
@ -710,7 +710,7 @@ ecdb_burn_data_cleanup(Ecdb_Page *page)
ECDB_PROJECT(proj)->ret, ECDB_PROJECT(proj)->begin, ECDB_PROJECT(proj)->ret, ECDB_PROJECT(proj)->begin,
NULL}; NULL};
for (i = 0; objs[i]; i++) for (i = 0; objs[i]; i++)
edje_object_signal_emit(objs[idx], "ecdb,disable", "ecdb"); edje_object_signal_emit(objs[i], "ecdb,disable", "ecdb");
edje_object_signal_emit(page->data, "ecdb,burn_data,start", "ecdb"); edje_object_signal_emit(page->data, "ecdb,burn_data,start", "ecdb");
edje_object_part_text_set(page->data, "progress_text", "Burn Complete!"); edje_object_part_text_set(page->data, "progress_text", "Burn Complete!");

View File

@ -3,6 +3,6 @@
#define ECDB_BURN_DATA_GUI_H #define ECDB_BURN_DATA_GUI_H
void ecdb_burn_data_page_show(Ecdb_Page *page); void ecdb_burn_data_page_show(Ecdb_Page *page);
void ecdb_burn_data_cleanup(Ecdb_Burn_Project *proj); void ecdb_burn_data_cleanup(Ecdb_Page *page);
#endif #endif

View File

@ -108,7 +108,7 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
return; return;
} }
burn_result = ecdb_burn_project(ECDB_BURN(proj)); burn_result = ecdb_burn_project(ECDB_BURN(proj), page);
switch (burn_result) switch (burn_result)
{ {
case ECDB_ERROR_NONE: case ECDB_ERROR_NONE:
@ -281,7 +281,7 @@ ecdb_burn_image_page_show(Ecdb_Page *page)
void void
ecdb_burn_image_cleanup(Ecdb_Page *page) ecdb_burn_image_cleanup(Ecdb_Page *page)
{ {
Ecdb_Burn_Image_Project *proj; Ecdb_Image_Project *proj;
int idx; int idx;
if (!page) if (!page)
@ -301,7 +301,7 @@ ecdb_burn_image_cleanup(Ecdb_Page *page)
ECDB_PROJECT(proj)->begin, ECDB_PROJECT(proj)->drive_combo, ECDB_PROJECT(proj)->begin, ECDB_PROJECT(proj)->drive_combo,
ECDB_BURN(proj)->speed_combo, NULL}; ECDB_BURN(proj)->speed_combo, NULL};
for (idx = 0; objs[idx]; idx++) for (idx = 0; objs[idx]; idx++)
edje_object_signal_emit(objs[i], "ecdb,enable", "ecdb"); edje_object_signal_emit(objs[idx], "ecdb,enable", "ecdb");
edje_object_part_text_set(page->image, "progress_text", "Burn Complete!"); edje_object_part_text_set(page->image, "progress_text", "Burn Complete!");
edje_object_signal_emit(page->image, "ecdb,burn_image,done", "ecdb"); edje_object_signal_emit(page->image, "ecdb,burn_image,done", "ecdb");

View File

@ -84,7 +84,7 @@ struct _Ecdb_Project_Info
Ecdb_Drive_Info *drive; Ecdb_Drive_Info *drive;
Ecore_Event_Handler *ev_handler; Ecore_Event_Handler *ev_handler;
Ecore_Pipe *pipe; Ecore_Pipe *pipe;
unsigned int type; Ecdb_Project_Type type;
/* Every project has these */ /* Every project has these */
Evas_Object *ret; Evas_Object *ret;

View File

@ -18,7 +18,7 @@ ecdb_erase_disc(Ecdb_Erase_Project *proj, Ecdb_Page *page)
{ {
BurnDriveStatus disc_state; BurnDriveStatus disc_state;
pthread_t progress_update; pthread_t progress_update;
Erase_Disc *data; Erase_Data *data;
data = calloc(1, sizeof(Erase_Data)); data = calloc(1, sizeof(Erase_Data));
if (!data) if (!data)
@ -26,7 +26,7 @@ ecdb_erase_disc(Ecdb_Erase_Project *proj, Ecdb_Page *page)
printf("ecdb_erase_disc: NULL data!\n"); printf("ecdb_erase_disc: NULL data!\n");
return FALSE; return FALSE;
} }
data->proj = proj; data->proj = ECDB_PROJECT(proj);
data->page = page; data->page = page;
disc_state = burn_disc_get_status(ECDB_PROJECT(proj)->drive-> disc_state = burn_disc_get_status(ECDB_PROJECT(proj)->drive->
@ -116,14 +116,14 @@ ecdb_erase_progress_handler(void *data, void *buffer, unsigned int nbyte)
return; return;
} }
switch (proj->type) switch (edata->proj->type)
{ {
case ECDB_ERASE_PROJECT: case ECDB_ERASE_PROJECT:
swallow = page->erase; swallow = edata->page->erase;
break; break;
default: default:
printf("ecdb_erase_progress_handler: Unrecognized project type!\n") printf("ecdb_erase_progress_handler: Unrecognized project type!\n");
return; return;
} }
@ -143,13 +143,14 @@ ecdb_erase_finished(void *data, int type, void *event)
Ecdb_Erase_Project *proj; Ecdb_Erase_Project *proj;
ed = data; ed = data;
proj = ed->proj; proj = ECDB_ERASE(ed->proj);
burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 0); burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 0);
burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible); burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible);
ecore_event_handler_del(ECDB_PROJECT(proj)->ev_handler); ecore_event_handler_del(ECDB_PROJECT(proj)->ev_handler);
ecore_pipe_del(ECDB_PROJECT(proj)->pipe); ecore_pipe_del(ECDB_PROJECT(proj)->pipe);
ecdb_erase_cleanup(ed->page); ecdb_erase_cleanup(ed->page);
FREE(ed);
return TRUE; return TRUE;
} }

View File

@ -3,6 +3,7 @@
#define ECDB_ERASE_H #define ECDB_ERASE_H
void ecdb_erase_project_start(Ecdb_Erase_Project *proj); void ecdb_erase_project_start(Ecdb_Erase_Project *proj);
int ecdb_erase_disc(Ecdb_Erase_Project *proj); int ecdb_erase_disc(Ecdb_Erase_Project *proj,
Ecdb_Page *page);
#endif #endif

View File

@ -81,7 +81,7 @@ _button_cb_begin(void *data, Evas_Object *o __UNUSED__,
proj->quick = ecdb_check_checked_get(proj->speed); proj->quick = ecdb_check_checked_get(proj->speed);
// TODO: Error Messages here // TODO: Error Messages here
if (!ecdb_erase_disc(proj)) if (!ecdb_erase_disc(proj, page))
{ {
printf("Disc not erasable!\n"); printf("Disc not erasable!\n");
snprintf(buf, sizeof(buf), "Disc not erasable!"); snprintf(buf, sizeof(buf), "Disc not erasable!");
@ -186,7 +186,7 @@ ecdb_erase_cleanup(Ecdb_Page *page)
return; return;
} }
proj = evas_object_data_get(proj->erase, "proj"); proj = evas_object_data_get(page->erase, "proj");
if (!proj) if (!proj)
{ {
printf("ecdb_erase_cleanup: NULL proj!\n"); printf("ecdb_erase_cleanup: NULL proj!\n");

View File

@ -3,6 +3,6 @@
#define ECDB_ERASE_GUI_H #define ECDB_ERASE_GUI_H
void ecdb_erase_page_show(Ecdb_Page *page); void ecdb_erase_page_show(Ecdb_Page *page);
void ecdb_erase_cleanup(void); void ecdb_erase_cleanup(Ecdb_Page *page);
#endif #endif

View File

@ -50,13 +50,15 @@ ecdb_source_destroy(Ecdb_Source *src)
/* free the non-recursive stuff */ /* free the non-recursive stuff */
if (src->dst) eina_stringshare_del(src->dst); if (src->dst) eina_stringshare_del(src->dst);
if (src->node) iso_node_unref(src->node); if (src->node) iso_node_unref(src->node);
if (src->children)
for (i = 0; src->children[i]; i++)
{ {
child = src->children[i]; for (i = 0; src->children[i]; i++)
ecdb_source_destroy(child); {
child = src->children[i];
ecdb_source_destroy(child);
}
FREE(src->children);
} }
FREE(src->children);
FREE(src); FREE(src);
} }
@ -253,7 +255,7 @@ ecdb_image_project(Ecdb_Burn_Project *bp)
efreet_mime_shutdown(); efreet_mime_shutdown();
} }
if (ECDB_PROJECT(bp)->type != ECDB_DATA_PROJECT) if (ECDB_PROJECT(bp)->type == ECDB_DATA_PROJECT)
{ {
proj = ECDB_DATA(bp); proj = ECDB_DATA(bp);
} }

View File

@ -38,7 +38,7 @@ ecdb_project_destroy(Ecdb_Project *proj)
{ {
if (proj->ev_handler) ecore_event_handler_del(proj->ev_handler); if (proj->ev_handler) ecore_event_handler_del(proj->ev_handler);
if (proj->pipe) ecore_pipe_del(proj->pipe); if (proj->pipe) ecore_pipe_del(proj->pipe);
printf("Destroying base project\n"); printf("base\n");
} }
void void
@ -86,9 +86,9 @@ ecdb_burn_project_init(Ecdb_Burn_Project *proj)
void void
ecdb_burn_project_destroy(Ecdb_Burn_Project *proj) ecdb_burn_project_destroy(Ecdb_Burn_Project *proj)
{ {
printf("burn --> ");
if (proj->files) ecdb_source_destroy(proj->files); if (proj->files) ecdb_source_destroy(proj->files);
ecdb_project_destroy(ECDB_PROJECT(proj)); ecdb_project_destroy(ECDB_PROJECT(proj));
printf("Destroying burn project\n");
} }
Ecdb_Erase_Project * Ecdb_Erase_Project *
@ -130,6 +130,7 @@ ecdb_erase_project_init(Ecdb_Erase_Project *proj)
void void
ecdb_erase_project_destroy(Ecdb_Erase_Project *proj) ecdb_erase_project_destroy(Ecdb_Erase_Project *proj)
{ {
printf("Destroying: erase --> ");
ecdb_project_destroy(ECDB_PROJECT(proj)); ecdb_project_destroy(ECDB_PROJECT(proj));
FREE(proj); FREE(proj);
} }
@ -169,6 +170,7 @@ ecdb_audio_project_init(Ecdb_Audio_Project *proj)
void void
ecdb_audio_project_destroy(Ecdb_Audio_Project *proj) ecdb_audio_project_destroy(Ecdb_Audio_Project *proj)
{ {
printf("Destroying: audio --> ");
ecdb_burn_project_destroy(ECDB_BURN(proj)); ecdb_burn_project_destroy(ECDB_BURN(proj));
FREE(proj); FREE(proj);
} }
@ -211,6 +213,7 @@ ecdb_data_project_init(Ecdb_Data_Project *proj)
void void
ecdb_data_project_destroy(Ecdb_Data_Project *proj) ecdb_data_project_destroy(Ecdb_Data_Project *proj)
{ {
printf("Destroying: data --> ");
FREE(proj->volume_id); FREE(proj->volume_id);
FREE(proj->publisher_id); FREE(proj->publisher_id);
FREE(proj->data_preparer_id); FREE(proj->data_preparer_id);
@ -256,6 +259,7 @@ ecdb_image_project_init(Ecdb_Image_Project *proj)
void void
ecdb_image_project_destroy(Ecdb_Image_Project *proj) ecdb_image_project_destroy(Ecdb_Image_Project *proj)
{ {
printf("Destroying: image --> ");
ecdb_burn_project_destroy(ECDB_BURN(proj)); ecdb_burn_project_destroy(ECDB_BURN(proj));
FREE(proj); FREE(proj);
} }