Commit 60d40284 authored by hjk's avatar hjk Committed by hjk
Browse files

valgrind: fake some kind of 'progress'



Change-Id: I93b6c20a986004fbf8fc84df368ac53a18766cc5
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 94d8ff1c
......@@ -52,6 +52,8 @@ using namespace Analyzer;
using namespace Valgrind::Internal;
using namespace Utils;
const int progressMaximum = 1000000;
ValgrindEngine::ValgrindEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
: IAnalyzerEngine(tool, sp, runConfiguration),
......@@ -84,8 +86,10 @@ bool ValgrindEngine::start()
Core::FutureProgress *fp = Core::ICore::instance()->progressManager()->addTask(m_progress->future(),
progressTitle(), "valgrind");
fp->setKeepOnFinish(Core::FutureProgress::HideOnFinish);
m_progress->setProgressRange(0, progressMaximum);
m_progress->reportStarted();
m_progressWatcher->setFuture(m_progress->future());
m_progress->setProgressValue(progressMaximum / 10);
#if VALGRIND_DEBUG_OUTPUT
emit outputReceived(tr("Valgrind options: %1").arg(toolArguments().join(" ")), Utils::DebugFormat);
......@@ -154,6 +158,12 @@ void ValgrindEngine::runnerFinished()
void ValgrindEngine::receiveProcessOutput(const QByteArray &b, Utils::OutputFormat format)
{
int progress = m_progress->progressValue();
if (progress < 5 * progressMaximum / 10)
progress += progress / 100;
else if (progress < 9 * progressMaximum / 10)
progress += progress / 1000;
m_progress->setProgressValue(progress);
emit outputReceived(QString::fromLocal8Bit(b), format);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment