Fix the progress parser for Valibdec. There's a leading whitespace character, if the progress is < 10%.

This commit is contained in:
LoRd_MuldeR 2011-03-21 17:36:43 +01:00
parent 01b15d6f70
commit 7e306384f6
5 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 1 #define VER_LAMEXP_MINOR_LO 1
#define VER_LAMEXP_BUILD 387 #define VER_LAMEXP_BUILD 390
#define VER_LAMEXP_SUFFIX Beta-10 #define VER_LAMEXP_SUFFIX Beta-10
/* /*

View File

@ -57,7 +57,7 @@ bool AC3Decoder::decode(const QString &sourceFile, const QString &outputFile, vo
bool bTimeout = false; bool bTimeout = false;
bool bAborted = false; bool bAborted = false;
QRegExp regExp("\\[(\\d+)\\.(\\d+)%\\]"); QRegExp regExp("\\[(\\s*)(\\d+)\\.(\\d+)%\\]");
while(process.state() != QProcess::NotRunning) while(process.state() != QProcess::NotRunning)
{ {
@ -84,7 +84,7 @@ bool AC3Decoder::decode(const QString &sourceFile, const QString &outputFile, vo
if(regExp.lastIndexIn(text) >= 0) if(regExp.lastIndexIn(text) >= 0)
{ {
bool ok = false; bool ok = false;
int progress = regExp.cap(1).toInt(&ok); int progress = regExp.cap(2).toInt(&ok);
if(ok) emit statusUpdated(progress); if(ok) emit statusUpdated(progress);
} }
else if(!text.isEmpty()) else if(!text.isEmpty())

View File

@ -958,7 +958,7 @@ const QString &lamexp_temp_folder2(void)
/* /*
* Clean folder * Clean folder
*/ */
bool lamexp_clean_folder(const QString folderPath) bool lamexp_clean_folder(const QString &folderPath)
{ {
QDir tempFolder(folderPath); QDir tempFolder(folderPath);
QFileInfoList entryList = tempFolder.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot); QFileInfoList entryList = tempFolder.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot);

View File

@ -107,7 +107,7 @@ bool lamexp_install_translator(const QString &language);
static const char* LAMEXP_DEFAULT_LANGID = "en"; static const char* LAMEXP_DEFAULT_LANGID = "en";
//Auxiliary functions //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); const QString lamexp_version2string(const QString &pattern, unsigned int version, const QString &defaultText);
QString lamexp_known_folder(lamexp_known_folder_t folder_id); QString lamexp_known_folder(lamexp_known_folder_t folder_id);
__int64 lamexp_free_diskspace(const QString &path); __int64 lamexp_free_diskspace(const QString &path);