comparison src/hgrunner.cpp @ 408:005633eed862

Add uniDecode, and use it when parsing logs so as to decode "\uABCD" substrings. Also force Hg encoding to utf-8.
author Chris Cannam
date Mon, 06 Jun 2011 21:20:11 +0100
parents b45e6cd9f1d4
children 66ec8b2ee946
comparison
equal deleted inserted replaced
407:b45e6cd9f1d4 408:005633eed862
284 } 284 }
285 285
286 void HgRunner::dataReadyStdout() 286 void HgRunner::dataReadyStdout()
287 { 287 {
288 DEBUG << "dataReadyStdout" << endl; 288 DEBUG << "dataReadyStdout" << endl;
289 if (!m_proc) return; 289 if (!m_proc) return;
290 QString chunk = QString::fromUtf8(m_proc->readAllStandardOutput()); 290 QString chunk = QString::fromUtf8(m_proc->readAllStandardOutput());
291 if (!checkPrompts(chunk)) { 291 if (!checkPrompts(chunk)) {
292 m_stdout += chunk; 292 m_stdout += chunk;
293 } 293 }
294 } 294 }
295 295
296 void HgRunner::dataReadyStderr() 296 void HgRunner::dataReadyStderr()
297 { 297 {
298 DEBUG << "dataReadyStderr" << endl; 298 DEBUG << "dataReadyStderr" << endl;
299 if (!m_proc) return; 299 if (!m_proc) return;
300 QString chunk = QString::fromUtf8(m_proc->readAllStandardError()); 300 QString chunk = QString::fromUtf8(m_proc->readAllStandardError());
301 DEBUG << chunk; 301 DEBUG << chunk;
302 if (!checkPrompts(chunk)) { 302 if (!checkPrompts(chunk)) {
303 m_stderr += chunk; 303 m_stderr += chunk;
304 } 304 }
455 } 455 }
456 #endif 456 #endif
457 457
458 env.insert("LANG", "en_US.utf8"); 458 env.insert("LANG", "en_US.utf8");
459 env.insert("LC_ALL", "en_US.utf8"); 459 env.insert("LC_ALL", "en_US.utf8");
460 env.insert("HGENCODING", "utf8");
460 env.insert("HGPLAIN", "1"); 461 env.insert("HGPLAIN", "1");
461 m_proc->setProcessEnvironment(env); 462 m_proc->setProcessEnvironment(env);
462 463
463 connect(m_proc, SIGNAL(started()), this, SLOT(started())); 464 connect(m_proc, SIGNAL(started()), this, SLOT(started()));
464 connect(m_proc, SIGNAL(error(QProcess::ProcessError)), 465 connect(m_proc, SIGNAL(error(QProcess::ProcessError)),