From 285746235e78033c79347329b4b14e563995653f Mon Sep 17 00:00:00 2001 From: lordmulder Date: Tue, 29 May 2012 18:32:28 +0200 Subject: [PATCH] CueSheet Importer: Fixed generation of the initial (suggested) output folder name when the CUE file name ends with one or multiple dots. --- src/Config.h | 2 +- src/Dialog_CueImport.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Config.h b/src/Config.h index 37cd8109..7d1e04f7 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 5 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 3 -#define VER_LAMEXP_BUILD 1031 +#define VER_LAMEXP_BUILD 1032 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Dialog_CueImport.cpp b/src/Dialog_CueImport.cpp index 6e8367d7..eedf457e 100644 --- a/src/Dialog_CueImport.cpp +++ b/src/Dialog_CueImport.cpp @@ -175,10 +175,14 @@ int CueImportDialog::exec(void) //----------------------// - m_outputDir = QString("%1/%2").arg(cueFileInfo.canonicalPath(), cueFileInfo.completeBaseName()); + QString baseName = cueFileInfo.completeBaseName().simplified(); + while(m_outputDir.endsWith(".") || m_outputDir.endsWith(" ")) m_outputDir.chop(1); + if(m_outputDir.isEmpty()) baseName = "New Folder"; + + m_outputDir = QString("%1/%2").arg(cueFileInfo.canonicalPath(), baseName); for(int n = 2; QDir(m_outputDir).exists(); n++) { - m_outputDir = QString("%1/%2 (%3)").arg(cueFileInfo.canonicalPath(), cueFileInfo.completeBaseName(), QString::number(n)); + m_outputDir = QString("%1/%2 (%3)").arg(cueFileInfo.canonicalPath(), baseName, QString::number(n)); } setWindowTitle(QString("%1: %2").arg(windowTitle().split(":", QString::SkipEmptyParts).first().trimmed(), cueFileInfo.fileName()));