diff --git a/doc/Changelog.html b/doc/Changelog.html
index 38506b95..f00d19dd 100644
--- a/doc/Changelog.html
+++ b/doc/Changelog.html
@@ -21,6 +21,7 @@ a:visited { color: #0000EE; }
Updated mpg123 decoder to v1.20.1 (2014-06-17), compiled with GCC 4.9.0
Updated Vorbis encoder to OggEnc v2.87 (2014-06-24), using libvorbis v1.3.4 and aoTuV b6.03_2014
Updated Vorbis decoder to OggDec v1.10.1 (2014-06-25), using libVorbis v1.3.4
+Fixed potential crash in Cue Sheet importer (occurred when *all* input files were missing)
Changes between v4.09 and v4.10 [2014-06-23]:
diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts
index b1b3b4a5..06715f6d 100644
--- a/etc/Translation/Blank.ts
+++ b/etc/Translation/Blank.ts
@@ -434,8 +434,9 @@
-
-
+
+
+
Cue Sheet Error
@@ -542,63 +543,70 @@
-
+
+ Warning: Some of the required input files could not be found!
+
+
+
+
Analyzing file(s), please wait...
-
+
Analysis Failed
-
+
Warning: The format of some of the input files could not be determined!
-
+
+
Continue Anyway
-
+
+
Abort
-
+
Splitting file(s), please wait...
-
+
Process was aborted by the user after %n track(s)!
-
+
An unexpected error has occured while splitting the Cue Sheet!
-
+
Imported %n track(s) from the Cue Sheet.
-
+
Skipped %n track(s).
-
+
Cue Sheet Completed
diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts
index 86dda113..4510a55d 100644
--- a/etc/Translation/LameXP_DE.ts
+++ b/etc/Translation/LameXP_DE.ts
@@ -470,6 +470,10 @@
%n Dateien übersprungen.
+
+ Warning: Some of the required input files could not be found!
+ Achtung: Einige der Eingabedateien konnten nicht gefunden werden!
+
CueSheetImport
diff --git a/etc/Translation/LameXP_EN.ts b/etc/Translation/LameXP_EN.ts
index 362616b4..981f7d24 100644
--- a/etc/Translation/LameXP_EN.ts
+++ b/etc/Translation/LameXP_EN.ts
@@ -4,7 +4,7 @@
CueImportDialog
-
+
Process was aborted by the user after %n track(s)!
Process was aborted by the user after %n track!
@@ -12,7 +12,7 @@
-
+
Imported %n track(s) from the Cue Sheet.
Imported %n track from the Cue Sheet.
@@ -20,7 +20,7 @@
-
+
Skipped %n track(s).
Skipped %n track.
diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts
index 5df58aeb..ec45146e 100644
--- a/etc/Translation/LameXP_ES.ts
+++ b/etc/Translation/LameXP_ES.ts
@@ -470,6 +470,10 @@
%n pistas omitidas.
+
+ Warning: Some of the required input files could not be found!
+
+
CueSheetImport
diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts
index d2f7805a..8e760c3f 100644
--- a/etc/Translation/LameXP_FR.ts
+++ b/etc/Translation/LameXP_FR.ts
@@ -474,6 +474,10 @@
%n pistes ignorées.
+
+ Warning: Some of the required input files could not be found!
+
+
CueSheetImport
diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts
index 20c35837..7cb5b740 100644
--- a/etc/Translation/LameXP_IT.ts
+++ b/etc/Translation/LameXP_IT.ts
@@ -470,6 +470,10 @@
+
+ Warning: Some of the required input files could not be found!
+
+
CueSheetImport
diff --git a/etc/Translation/LameXP_KR.ts b/etc/Translation/LameXP_KR.ts
index 54f90e61..5564fcf3 100644
--- a/etc/Translation/LameXP_KR.ts
+++ b/etc/Translation/LameXP_KR.ts
@@ -468,6 +468,10 @@
%n 트랙을 건너뛰었습니다.
+
+ Warning: Some of the required input files could not be found!
+
+
CueSheetImport
diff --git a/etc/Translation/LameXP_PL.ts b/etc/Translation/LameXP_PL.ts
index c09f47c4..d0510919 100644
--- a/etc/Translation/LameXP_PL.ts
+++ b/etc/Translation/LameXP_PL.ts
@@ -434,8 +434,9 @@
-
-
+
+
+
Cue Sheet Error
Błąd pliku Cue Sheet
@@ -542,37 +543,44 @@
Jest wysoce zalecane zwolnić miejsce na dysku zanim zaczniesz importować!
-
+
+ Warning: Some of the required input files could not be found!
+
+
+
+
Analyzing file(s), please wait...
Analizowanie pliku/ów, prosze czekać...
-
+
Analysis Failed
Analiza zakończona niepowodzeniem
-
+
Warning: The format of some of the input files could not be determined!
Ostrzeżenie: Nie można rozpoznać formatu kilku plików wejściowych!
-
+
+
Continue Anyway
Kontynuuj pomimo to
-
+
+
Abort
Przerwij
-
+
Splitting file(s), please wait...
Dzielenie pliku/ów, prosze czekać...
-
+
Process was aborted by the user after %n track(s)!
Proces został przerwany przez użytkownika po zakończeniu %n ścieżki!
@@ -581,12 +589,12 @@
-
+
An unexpected error has occured while splitting the Cue Sheet!
Wystąpił nieoczekiwany błąd podczas podziału pliku Cue Sheet!
-
+
Imported %n track(s) from the Cue Sheet.
Zaimportowano %n ścieżkę z pliku Cue Sheet.
@@ -595,7 +603,7 @@
-
+
Skipped %n track(s).
Pominięto %n ścieżkę.
@@ -604,7 +612,7 @@
-
+
Cue Sheet Completed
Utworzono plik Cue Sheet
diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts
index cf546bc6..160be0cd 100644
--- a/etc/Translation/LameXP_RU.ts
+++ b/etc/Translation/LameXP_RU.ts
@@ -475,6 +475,10 @@
Пропущено %n трэков.
+
+ Warning: Some of the required input files could not be found!
+
+
CueSheetImport
diff --git a/etc/Translation/LameXP_SV.ts b/etc/Translation/LameXP_SV.ts
index 9c48f946..0c4a5712 100644
--- a/etc/Translation/LameXP_SV.ts
+++ b/etc/Translation/LameXP_SV.ts
@@ -435,8 +435,9 @@
-
-
+
+
+
Cue Sheet Error
Cue-fel
@@ -543,37 +544,44 @@
Du bör frigöra mer diskutrymme innan du fortsätter med importen!
-
+
+ Warning: Some of the required input files could not be found!
+
+
+
+
Analyzing file(s), please wait...
Analyserar fil(er), vänta...
-
+
Analysis Failed
Analys misslyckades
-
+
Warning: The format of some of the input files could not be determined!
Varning! Formatet på vissa filer kunde inte avgöras!
-
+
+
Continue Anyway
Fortsätt ändå
-
+
+
Abort
Avbryt
-
+
Splitting file(s), please wait...
Delar fil(er), vänta...
-
+
Process was aborted by the user after %n track(s)!
Åtgärden avbröts av användaren efter %n spår!
@@ -581,12 +589,12 @@
-
+
An unexpected error has occured while splitting the Cue Sheet!
Ett oväntat fel uppstod vid delningen av cue-filen!
-
+
Imported %n track(s) from the Cue Sheet.
Importerade %n spår från cue-filen.
@@ -594,7 +602,7 @@
-
+
Skipped %n track(s).
Hoppade över %n spår.
@@ -602,7 +610,7 @@
-
+
Cue Sheet Completed
cue-fil färdigbearbetad
diff --git a/etc/Translation/LameXP_TW.ts b/etc/Translation/LameXP_TW.ts
index c5a15a52..cb41a1ef 100644
--- a/etc/Translation/LameXP_TW.ts
+++ b/etc/Translation/LameXP_TW.ts
@@ -467,6 +467,10 @@
已跳過 %n 條軌道.
+
+ Warning: Some of the required input files could not be found!
+
+
CueSheetImport
diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts
index 387e27b6..9cecd477 100644
--- a/etc/Translation/LameXP_UK.ts
+++ b/etc/Translation/LameXP_UK.ts
@@ -474,6 +474,10 @@
Пропущено %n доріжок.
+
+ Warning: Some of the required input files could not be found!
+
+
CueSheetImport
diff --git a/etc/Translation/LameXP_ZH.ts b/etc/Translation/LameXP_ZH.ts
index 7432e3be..353157d2 100644
--- a/etc/Translation/LameXP_ZH.ts
+++ b/etc/Translation/LameXP_ZH.ts
@@ -467,6 +467,10 @@
已跳过 %n 条音轨。
+
+ Warning: Some of the required input files could not be found!
+
+
CueSheetImport
diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm
index d288cd36..5e1f47a6 100644
Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ
diff --git a/res/localization/LameXP_UK.qm b/res/localization/LameXP_UK.qm
index a8ac669a..3746d67e 100644
Binary files a/res/localization/LameXP_UK.qm and b/res/localization/LameXP_UK.qm differ
diff --git a/res/localization/LameXP_ZH.qm b/res/localization/LameXP_ZH.qm
index 79d19179..de6e0ac3 100644
Binary files a/res/localization/LameXP_ZH.qm and b/res/localization/LameXP_ZH.qm differ
diff --git a/src/Config.h b/src/Config.h
index 123a52f8..11f41188 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -35,7 +35,7 @@
#define VER_LAMEXP_MINOR_LO 1
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 1
-#define VER_LAMEXP_BUILD 1565
+#define VER_LAMEXP_BUILD 1566
#define VER_LAMEXP_CONFG 1558
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/Dialog_CueImport.cpp b/src/Dialog_CueImport.cpp
index 10db6790..a4ed218b 100644
--- a/src/Dialog_CueImport.cpp
+++ b/src/Dialog_CueImport.cpp
@@ -330,41 +330,52 @@ void CueImportDialog::analyzedFile(const AudioFileModel &file)
void CueImportDialog::importCueSheet(void)
{
QStringList files;
+ QList locks;
//Fetch all files that are referenced in the Cue Sheet and lock them
int nFiles = m_model->getFileCount();
for(int i = 0; i < nFiles; i++)
{
- QString temp = m_model->getFileName(i);
try
{
- m_locks << new LockedFile(temp);
-
+ LockedFile *temp = new LockedFile(m_model->getFileName(i));
+ locks << temp;
+ files << temp->filePath();
}
catch(const std::exception &error)
{
qWarning("Failed to lock file:\n%s\n", error.what());
- continue;
}
catch(...)
{
qWarning("Failed to lock file!");
- continue;
}
- files << temp;
}
-
- //Analyze all source files first
- if(analyzeFiles(files))
+
+ //Check if all files could be locked
+ if(files.count() < m_model->getFileCount())
{
- //Now split files according to Cue Sheet
- splitFiles();
+ if(QMessageBox::warning(this, tr("Cue Sheet Error"), tr("Warning: Some of the required input files could not be found!"), tr("Continue Anyway"), tr("Abort")) == 1)
+ {
+ files.clear();
+ }
+ }
+
+ //Process all avialble input files
+ if(files.count() > 0)
+ {
+ //Analyze all source files first
+ if(analyzeFiles(files))
+ {
+ //Now split files according to Cue Sheet
+ splitFiles();
+ }
}
//Release locks
- while(!m_locks.isEmpty())
+ while(!locks.isEmpty())
{
- delete m_locks.takeFirst();
+ delete locks.takeFirst();
}
}
diff --git a/src/Dialog_CueImport.h b/src/Dialog_CueImport.h
index 8b73c893..1effa5af 100644
--- a/src/Dialog_CueImport.h
+++ b/src/Dialog_CueImport.h
@@ -68,7 +68,6 @@ private:
const SettingsModel *m_settings;
- QList m_locks;
QList m_fileInfo;
QString m_cueFileName;
QString m_outputDir;
diff --git a/src/LockedFile.cpp b/src/LockedFile.cpp
index 5601c519..b87cdd45 100644
--- a/src/LockedFile.cpp
+++ b/src/LockedFile.cpp
@@ -201,9 +201,9 @@ LockedFile::LockedFile(const QString &filePath, const bool bOwnsFile)
existingFileInfo.setCaching(false);
//Make sure the file exists, before we try to lock it
- if(!(existingFileInfo.exists() && existingFileInfo.isFile()))
+ if((!existingFileInfo.exists()) || (!existingFileInfo.isFile()) || m_filePath.isEmpty())
{
- THROW_FMT("File '%s' does not exist!", QUTF8(m_filePath));
+ THROW_FMT("File '%s' does not exist!", QUTF8(filePath));
}
//Now lock the file
diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp
index a72753bf..dd536fa2 100644
--- a/src/Thread_FileAnalyzer.cpp
+++ b/src/Thread_FileAnalyzer.cpp
@@ -76,9 +76,12 @@ FileAnalyzer::FileAnalyzer(const QStringList &inputFiles)
FileAnalyzer::~FileAnalyzer(void)
{
- if(!m_pool->waitForDone(2500))
+ if(m_pool)
{
- qWarning("There are still running tasks in the thread pool!");
+ if(!m_pool->waitForDone(2500))
+ {
+ qWarning("There are still running tasks in the thread pool!");
+ }
}
LAMEXP_DELETE(m_templateFile);