Mercurial > hg > easyhg
comparison hgrunner.cpp @ 80:32fa40c3d174
* OS/X doesn't like fork() without exec(). Scrap that, revert to ioctl
author | Chris Cannam |
---|---|
date | Mon, 22 Nov 2010 15:21:12 +0000 |
parents | b522aaa2c053 |
children | 8a4e26dc3182 |
comparison
equal
deleted
inserted
replaced
79:aaeabc920ca8 | 80:32fa40c3d174 |
---|---|
31 #include <unistd.h> | 31 #include <unistd.h> |
32 #include <errno.h> | 32 #include <errno.h> |
33 #include <stdio.h> | 33 #include <stdio.h> |
34 | 34 |
35 #ifndef Q_OS_WIN32 | 35 #ifndef Q_OS_WIN32 |
36 #ifdef Q_OS_MAC | |
37 #include <util.h> | |
38 #else | |
36 #include <pty.h> | 39 #include <pty.h> |
40 #endif | |
37 #endif | 41 #endif |
38 | 42 |
39 HgRunner::HgRunner(QWidget * parent): QProgressBar(parent) | 43 HgRunner::HgRunner(QWidget * parent): QProgressBar(parent) |
40 { | 44 { |
41 proc = new QProcess(this); | 45 proc = new QProcess(this); |
136 | 140 |
137 void HgRunner::stdOutReady() | 141 void HgRunner::stdOutReady() |
138 { | 142 { |
139 DEBUG << "stdOutReady" << endl; | 143 DEBUG << "stdOutReady" << endl; |
140 QString chunk = QString::fromUtf8(proc->readAllStandardOutput()); | 144 QString chunk = QString::fromUtf8(proc->readAllStandardOutput()); |
141 DEBUG << "stdout was " << chunk << endl; | 145 //DEBUG << "stdout was " << chunk << endl; |
142 stdOut += chunk; | 146 stdOut += chunk; |
143 } | 147 } |
144 | 148 |
145 void HgRunner::stdErrReady() | 149 void HgRunner::stdErrReady() |
146 { | 150 { |
147 DEBUG << "stdErrReady" << endl; | 151 DEBUG << "stdErrReady" << endl; |
148 QString chunk = QString::fromUtf8(proc->readAllStandardError()); | 152 QString chunk = QString::fromUtf8(proc->readAllStandardError()); |
149 DEBUG << "stderr was " << chunk << endl; | 153 //DEBUG << "stderr was " << chunk << endl; |
150 stdErr += chunk; | 154 stdErr += chunk; |
151 if (procInput) { | 155 if (procInput) { |
152 if (chunk.toLower().trimmed() == "password:") { | 156 if (chunk.toLower().trimmed() == "password:") { |
153 bool ok = false; | 157 bool ok = false; |
154 QString pwd = QInputDialog::getText | 158 QString pwd = QInputDialog::getText |