comparison hgrunner.cpp @ 45:4286836bb3c9

* Some more work on graph layout; ensure LANG is set for parseable UTF8 output when running Hg
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 10 Nov 2010 12:44:11 +0000
parents bed7ab59f62e
children c76782c14371
comparison
equal deleted inserted replaced
44:bed7ab59f62e 45:4286836bb3c9
10 #include <unistd.h> 10 #include <unistd.h>
11 11
12 HgRunner::HgRunner(QWidget * parent): QProgressBar(parent) 12 HgRunner::HgRunner(QWidget * parent): QProgressBar(parent)
13 { 13 {
14 proc = new QProcess(this); 14 proc = new QProcess(this);
15
16 QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
17 env.insert("LANG", "en_US.utf8");
18 env.insert("LC_ALL", "en_US.utf8");
19 proc->setProcessEnvironment(env);
15 20
16 setTextVisible(false); 21 setTextVisible(false);
17 setVisible(false); 22 setVisible(false);
18 isRunning = false; 23 isRunning = false;
19 24
37 42
38 void HgRunner::setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus) 43 void HgRunner::setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus)
39 { 44 {
40 exitCode = procExitCode; 45 exitCode = procExitCode;
41 exitStatus = procExitStatus; 46 exitStatus = procExitStatus;
42 stdOut = proc -> readAllStandardOutput(); 47 stdOut = QString::fromUtf8(proc -> readAllStandardOutput());
43 stdErr = proc -> readAllStandardError(); 48 stdErr = QString::fromUtf8(proc -> readAllStandardError());
44 std::cerr << "stdout was " << stdOut.toStdString() << std::endl; 49 std::cerr << "stdout was " << stdOut.toStdString() << std::endl;
45 } 50 }
46 51
47 void HgRunner::presentErrorToUser() 52 void HgRunner::presentErrorToUser()
48 { 53 {