diff options
| author | 2026-11-09 19:11:29 +0100 | |
|---|---|---|
| committer | 2026-11-09 19:11:29 +0100 | |
| commit | 6cead6bce881ce7bcc6878852f292de8050e20e6 (patch) | |
| tree | 2a738f3277d82da24ab209f8f704a7be31207439 | |
| parent | ae8cfb4aa919000b283a0fe7db96b1a321a010d3 (diff) | |
| download | idevicerestore-master.tar.gz idevicerestore-master.tar.bz2 | |
| -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); |
