[ostree] pull: Don't print, just use progress callback
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] pull: Don't print, just use progress callback
- Date: Fri, 21 Mar 2014 19:24:45 +0000 (UTC)
commit a80872afa0259a40ada83f433f4d243b496891ff
Author: Colin Walters <walters verbum org>
Date: Fri Mar 21 14:52:56 2014 -0400
pull: Don't print, just use progress callback
More work on removing g_print() from the library.
src/libostree/ostree-repo-pull.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 194c4ad..fa50b9b 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1230,7 +1230,7 @@ ostree_repo_pull (OstreeRepo *self,
end_time = g_get_monotonic_time ();
bytes_transferred = ostree_fetcher_bytes_transferred (pull_data->fetcher);
- if (bytes_transferred > 0)
+ if (bytes_transferred > 0 && pull_data->progress)
{
guint shift;
gs_free char *msg = NULL;
@@ -1245,10 +1245,7 @@ ostree_repo_pull (OstreeRepo *self,
(guint64)(bytes_transferred / shift),
shift == 1 ? "B" : "KiB",
(guint) ((end_time - start_time) / G_USEC_PER_SEC));
- if (pull_data->progress)
- ostree_async_progress_set_status (pull_data->progress, msg);
- else
- g_print ("%s\n", msg);
+ ostree_async_progress_set_status (pull_data->progress, msg);
}
ret = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]