diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2017-09-27 15:33:25 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2017-10-02 17:16:21 +0000 |
commit | d89229240918c567c915c1e444d5b60f2f4c958d (patch) | |
tree | f9652d57ef4d6a0f3513a48659ce4d3e46d82731 /examples/network/downloadmanager/textprogressbar.cpp | |
parent | 42d7bc4c00bac55bd1aa9da5695be93e3f51a6a1 (diff) |
QtNetwork (examples) - update the second download manager example
It's the one that is more complex - with a text-based 'progress-bar'
and queueing (for some, probably educational, reason) of requests.
Changes:
- update the C++ syntax (mem-initializers, range for, etc.)
- new-style headers
- redirects should not result in creating an empty file. Since we
have no UI, and this example is already complex enough, settle
for just reporting the redirect and removing the empty file.
Task-number: QTBUG-60628
Change-Id: I0b69cd77414ecac7c0bc6b2f8f787befc978de28
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'examples/network/downloadmanager/textprogressbar.cpp')
-rw-r--r-- | examples/network/downloadmanager/textprogressbar.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/network/downloadmanager/textprogressbar.cpp b/examples/network/downloadmanager/textprogressbar.cpp index d9506a563a..3449e6bad5 100644 --- a/examples/network/downloadmanager/textprogressbar.cpp +++ b/examples/network/downloadmanager/textprogressbar.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -49,22 +49,21 @@ ****************************************************************************/ #include "textprogressbar.h" + #include <QByteArray> -#include <stdio.h> -TextProgressBar::TextProgressBar() - : value(0), maximum(-1), iteration(0) -{ -} +#include <cstdio> + +using namespace std; void TextProgressBar::clear() { printf("\n"); fflush(stdout); - iteration = 0; value = 0; maximum = -1; + iteration = 0; } void TextProgressBar::update() |