As reported by Mauro Dreissig, the progress bar doesn't work and causes
a SIGSEGV due to a missing allocation. The code broke when Dirk
separated out the GUI from the core code, and I hadn't tried
divecomputer downloads since.
Reported-by: Mauro Dreissig <mukadr@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
hbox = gtk_hbox_new(FALSE, 6);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, TRUE, 3);
- devicedata.progress->bar = gtk_progress_bar_new();
- gtk_container_add(GTK_CONTAINER(hbox), devicedata.progress->bar);
+ devicedata.progress.bar = gtk_progress_bar_new();
+ gtk_container_add(GTK_CONTAINER(hbox), devicedata.progress.bar);
gtk_widget_show_all(dialog);
result = gtk_dialog_run(GTK_DIALOG(dialog));
printf("Event: waiting for user action\n");
break;
case DEVICE_EVENT_PROGRESS:
- update_progressbar(devdata->progress,
+ update_progressbar(&devdata->progress,
(double) progress->current / (double) progress->maximum);
break;
case DEVICE_EVENT_DEVINFO:
typedef struct device_data_t {
device_type_t type;
const char *name, *devname;
- progressbar_t *progress;
+ progressbar_t progress;
device_devinfo_t devinfo;
device_clock_t clock;
} device_data_t;