///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
QProcess process;
QStringList args;
+ process.setWorkingDirectory(QFileInfo(outputFile).absolutePath());
+
args << QDir::toNativeSeparators(sourceFile);
args << QDir::toNativeSeparators(outputFile);
bool bTimeout = false;
bool bAborted = false;
- QRegExp regExp("please wait: (\\d+)/(\\d+) \\[(\\d+)%\\]");
+ QRegExp regExp("(\\d+)/(\\d+) \\[(\\d+)%\\]");
while(process.state() != QProcess::NotRunning)
{
emit messageLogged("\nABORTED BY USER !!!");
break;
}
- process.waitForReadyRead();
+ process.waitForReadyRead(m_processTimeoutInterval);
if(!process.bytesAvailable() && process.state() == QProcess::Running)
{
process.kill();
emit statusUpdated(100);
emit messageLogged(QString().sprintf("\nExited with code: 0x%04X", process.exitCode()));
- if(bTimeout || bAborted || process.exitStatus() != QProcess::NormalExit || QFileInfo(outputFile).size() == 0)
+ if(bTimeout || bAborted || process.exitCode() != EXIT_SUCCESS || QFileInfo(outputFile).size() == 0)
{
return false;
}