Mercurial > hg > svcore
diff base/ProgressPrinter.cpp @ 517:77b4ce536d8f
* print Done when done
author | Chris Cannam |
---|---|
date | Thu, 11 Dec 2008 11:30:15 +0000 |
parents | 1aefb666ecfc |
children | 5ebcf099dab0 |
line wrap: on
line diff
--- a/base/ProgressPrinter.cpp Thu Dec 11 11:04:01 2008 +0000 +++ b/base/ProgressPrinter.cpp Thu Dec 11 11:30:15 2008 +0000 @@ -54,23 +54,23 @@ void ProgressPrinter::done() { - setProgress(100); + std::cerr << "\r" + << m_prefix.toStdString() + << (m_prefix == "" ? "" : " ") + << "Done" << std::endl; } void ProgressPrinter::setProgress(int progress) { if (progress == m_lastProgress) return; - if (progress == 100) std::cerr << "\r\n"; - else { - std::cerr << "\r" - << m_prefix.toStdString() - << (m_prefix == "" ? "" : " "); - if (m_definite) { - std::cerr << progress << "%"; - } else { - std::cerr << "|/-\\"[progress % 4]; - } + std::cerr << "\r" + << m_prefix.toStdString() + << (m_prefix == "" ? "" : " "); + if (m_definite) { + std::cerr << progress << "%"; + } else { + std::cerr << "|/-\\"[progress % 4]; } m_lastProgress = progress; }