diff options
author | Nikias Bassen | 2012-02-02 22:43:42 +0100 |
---|---|---|
committer | Nikias Bassen | 2012-02-02 22:43:42 +0100 |
commit | 5238ca38754c6b3faba376a74d0f2a9110397a92 (patch) | |
tree | b20831390eec87732e6619f93e36bdc0fcf01ebb | |
parent | 137acdcb938aaad3892f4f0748aadc4e756211b2 (diff) | |
download | idevicerestore-5238ca38754c6b3faba376a74d0f2a9110397a92.tar.gz idevicerestore-5238ca38754c6b3faba376a74d0f2a9110397a92.tar.bz2 |
restore: only reprint progress bar if progress changed
-rw-r--r-- | src/restore.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/restore.c b/src/restore.c index f960570..ec7d92e 100644 --- a/src/restore.c +++ b/src/restore.c @@ -360,6 +360,8 @@ const char* restore_progress_string(unsigned int operation) { } } +static int lastop = 0; + int restore_handle_progress_msg(restored_client_t client, plist_t msg) { plist_t node = NULL; uint64_t progress = 0; @@ -380,10 +382,14 @@ int restore_handle_progress_msg(restored_client_t client, plist_t msg) { plist_get_uint_val(node, &progress); if ((progress > 0) && (progress < 100)) { + if (operation != lastop) { + info("%s (%d)\n", restore_progress_string(operation), (int)operation); + } print_progress_bar((double) progress); } else { - info("%s\n", restore_progress_string(operation)); + info("%s (%d)\n", restore_progress_string(operation), (int)operation); } + lastop = operation; return 0; } |