diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common.c | 12 | ||||
| -rw-r--r-- | src/common.h | 1 | ||||
| -rw-r--r-- | src/idevicerestore.c | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c index 60b1a49..bd06691 100644 --- a/src/common.c +++ b/src/common.c @@ -843,10 +843,18 @@ static const char* restore_step_label(int step) } } -void idevicerestore_progress(struct idevicerestore_client_t* client, int step, double progress) +static int last_global_step = -1; + +void idevicerestore_progress_finish(void) { - static int last_global_step = -1; + if (last_global_step != -1) { + finalize_progress(GLOBAL_PROGRESS_TAG); + last_global_step = -1; + } +} +void idevicerestore_progress(struct idevicerestore_client_t* client, int step, double progress) +{ if (client && client->progress_cb) { client->progress_cb(step, progress, client->progress_cb_data); return; diff --git a/src/common.h b/src/common.h index c634e24..4b88129 100644 --- a/src/common.h +++ b/src/common.h @@ -199,6 +199,7 @@ int mkdir_with_parents(const char *dir, int mode); char *get_temp_filename(const char *prefix); void idevicerestore_progress(struct idevicerestore_client_t* client, int step, double progress); +void idevicerestore_progress_finish(void); #ifndef HAVE_STRSEP char* strsep(char** strp, const char* delim); diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 82691d7..61fa1be 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -1583,6 +1583,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client) } } + idevicerestore_progress_finish(); if (result == 0) { logger(LL_INFO, "DONE\n"); idevicerestore_progress(client, RESTORE_NUM_STEPS-1, 1.0); |
