fuel-scm/LoggedProcess.cpp
kostas 42ff9851f5 Moved LoggedProcess to separate files
Added message box when attempting to push or pull when no remote url has been set


FossilOrigin-Name: 3adc2a837ceb5080094dede9f0f3bdeb0e0429f0
2012-05-12 10:43:40 +00:00

23 lines
576 B
C++

#include "LoggedProcess.h"
///////////////////////////////////////////////////////////////////////////////
LoggedProcess::LoggedProcess(QObject *parent) : QProcess(parent)
{
setProcessChannelMode(QProcess::MergedChannels);
connect(this, SIGNAL(readyReadStandardOutput()), this, SLOT(onReadyReadStandardOutput()));
}
void LoggedProcess::getLogAndClear(QByteArray &buffer)
{
QMutexLocker lck(&mutex);
buffer = log;
log.clear();
}
void LoggedProcess::onReadyReadStandardOutput()
{
QMutexLocker lck(&mutex);
log.append(readAllStandardOutput());
}