Fix regular expression for new version of Monkey's Audio.

This commit is contained in:
LoRd_MuldeR 2012-01-27 03:21:59 +01:00
parent dbd0c860e1
commit 97ab6bd0be
2 changed files with 8 additions and 3 deletions

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_MINOR_LO 4
#define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 17 #define VER_LAMEXP_PATCH 17
#define VER_LAMEXP_BUILD 886 #define VER_LAMEXP_BUILD 888
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Tool versions (minimum expected versions!) // Tool versions (minimum expected versions!)

View File

@ -57,8 +57,9 @@ bool MACDecoder::decode(const QString &sourceFile, const QString &outputFile, vo
bool bTimeout = false; bool bTimeout = false;
bool bAborted = false; bool bAborted = false;
int prevProgress = -1;
QRegExp regExp("Progress: (\\d+)%"); QRegExp regExp("Progress: (\\d+).(\\d+)%");
while(process.state() != QProcess::NotRunning) while(process.state() != QProcess::NotRunning)
{ {
@ -86,7 +87,11 @@ bool MACDecoder::decode(const QString &sourceFile, const QString &outputFile, vo
{ {
bool ok = false; bool ok = false;
int progress = regExp.cap(1).toInt(&ok); int progress = regExp.cap(1).toInt(&ok);
if(ok) emit statusUpdated(progress); if(ok && (progress > prevProgress))
{
emit statusUpdated(progress);
prevProgress = qMin(progress + 2, 99);
}
} }
else if(!text.isEmpty()) else if(!text.isEmpty())
{ {