diff --git a/src/common/variables.c b/src/common/variables.c index ff4b94d..14ef0bf 100644 --- a/src/common/variables.c +++ b/src/common/variables.c @@ -192,6 +192,7 @@ void dt_variables_params_init(dt_variables_params_t **params) memset((*params)->data ,0,sizeof(dt_variables_data_t)); (*params)->data->time=time(NULL); (*params)->sequence = -1; + (*params)->progress = 0; } void dt_variables_params_destroy(dt_variables_params_t *params) diff --git a/src/common/variables.h b/src/common/variables.h index 126181f..26fbea3 100644 --- a/src/common/variables.h +++ b/src/common/variables.h @@ -37,6 +37,9 @@ typedef struct dt_variables_params_t /** used as thread-safe sequence number. only used if >= 0. */ int sequence; + /** used as thread-safe progress counter */ + int progress; + /** internal variables data */ struct dt_variables_data_t *data; diff --git a/src/imageio/storage/disk.c b/src/imageio/storage/disk.c index c373762..4468758 100644 --- a/src/imageio/storage/disk.c +++ b/src/imageio/storage/disk.c @@ -224,7 +224,10 @@ failed: printf("[export_job] exported to `%s'\n", filename); char *trunc = filename + strlen(filename) - 32; if(trunc < filename) trunc = filename; - dt_control_log(_("%d/%d exported to `%s%s'"), num, total, trunc != filename ? ".." : "", trunc); + dt_pthread_mutex_lock(&darktable.plugin_threadsafe); + d->vp->progress++; + dt_control_log(_("%d/%d exported to `%s%s'"), d->vp->progress, total, trunc != filename ? ".." : "", trunc); + dt_pthread_mutex_unlock(&darktable.plugin_threadsafe); return 0; }