OSDN Git Service

Fix the progress parser for Valibdec. There's a leading whitespace character, if...
authorlordmulder <mulder2@gmx.de>
Mon, 21 Mar 2011 16:36:43 +0000 (17:36 +0100)
committerlordmulder <mulder2@gmx.de>
Mon, 21 Mar 2011 16:36:43 +0000 (17:36 +0100)
src/Config.h
src/Decoder_AC3.cpp
src/Global.cpp
src/Global.h
src/Thread_Initialization.cpp

index 778c85e..3206dfb 100644 (file)
@@ -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
 
 /*
index 87c469f..96bfe19 100644 (file)
@@ -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())
index 75ade01..8078d01 100644 (file)
@@ -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);
index 883cc16..3f0a5e3 100644 (file)
@@ -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);
index b03251c..c68152c 100644 (file)
@@ -91,7 +91,7 @@ void InitializationThread::run()
 {
        m_bSuccess = false;
        delay();
-       
+
        QMap<QString, QString> checksum;
        QMap<QString, unsigned int> version;