From 7e306384f69dfb40a0fe0d457f7043777f6581bd Mon Sep 17 00:00:00 2001 From: lordmulder Date: Mon, 21 Mar 2011 17:36:43 +0100 Subject: [PATCH] Fix the progress parser for Valibdec. There's a leading whitespace character, if the progress is < 10%. --- src/Config.h | 2 +- src/Decoder_AC3.cpp | 4 ++-- src/Global.cpp | 2 +- src/Global.h | 2 +- src/Thread_Initialization.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Config.h b/src/Config.h index 778c85eb..3206dfbd 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 1 -#define VER_LAMEXP_BUILD 387 +#define VER_LAMEXP_BUILD 390 #define VER_LAMEXP_SUFFIX Beta-10 /* diff --git a/src/Decoder_AC3.cpp b/src/Decoder_AC3.cpp index 87c469f1..96bfe190 100644 --- a/src/Decoder_AC3.cpp +++ b/src/Decoder_AC3.cpp @@ -57,7 +57,7 @@ bool AC3Decoder::decode(const QString &sourceFile, const QString &outputFile, vo bool bTimeout = false; bool bAborted = false; - QRegExp regExp("\\[(\\d+)\\.(\\d+)%\\]"); + QRegExp regExp("\\[(\\s*)(\\d+)\\.(\\d+)%\\]"); while(process.state() != QProcess::NotRunning) { @@ -84,7 +84,7 @@ bool AC3Decoder::decode(const QString &sourceFile, const QString &outputFile, vo if(regExp.lastIndexIn(text) >= 0) { bool ok = false; - int progress = regExp.cap(1).toInt(&ok); + int progress = regExp.cap(2).toInt(&ok); if(ok) emit statusUpdated(progress); } else if(!text.isEmpty()) diff --git a/src/Global.cpp b/src/Global.cpp index 75ade01f..8078d01a 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -958,7 +958,7 @@ const QString &lamexp_temp_folder2(void) /* * Clean folder */ -bool lamexp_clean_folder(const QString folderPath) +bool lamexp_clean_folder(const QString &folderPath) { QDir tempFolder(folderPath); QFileInfoList entryList = tempFolder.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot); diff --git a/src/Global.h b/src/Global.h index 883cc164..3f0a5e3e 100644 --- a/src/Global.h +++ b/src/Global.h @@ -107,7 +107,7 @@ bool lamexp_install_translator(const QString &language); static const char* LAMEXP_DEFAULT_LANGID = "en"; //Auxiliary functions -bool lamexp_clean_folder(const QString folderPath); +bool lamexp_clean_folder(const QString &folderPath); const QString lamexp_version2string(const QString &pattern, unsigned int version, const QString &defaultText); QString lamexp_known_folder(lamexp_known_folder_t folder_id); __int64 lamexp_free_diskspace(const QString &path); diff --git a/src/Thread_Initialization.cpp b/src/Thread_Initialization.cpp index b03251cf..c68152c5 100644 --- a/src/Thread_Initialization.cpp +++ b/src/Thread_Initialization.cpp @@ -91,7 +91,7 @@ void InitializationThread::run() { m_bSuccess = false; delay(); - + QMap checksum; QMap version;