summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeslie Zhai <[email protected]>2017-06-12 15:19:10 +0800
committerLeslie Zhai <[email protected]>2017-06-12 15:19:10 +0800
commit25e85085582e4d4540425204978ddd82bedd2782 (patch)
treee0a233dd14590097df32506d3629c59290d16885
parent81b4b37b9b580ac701a57c570c8eca58d1b33331 (diff)
Fix unnecessary spaces to file names of tracks extracted from audio cd issue.
-rw-r--r--src/rip/k3bpatternparser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rip/k3bpatternparser.cpp b/src/rip/k3bpatternparser.cpp
index 8d6173e..142658f 100644
--- a/src/rip/k3bpatternparser.cpp
+++ b/src/rip/k3bpatternparser.cpp
@@ -24,7 +24,7 @@
#include <QtCore/QLocale>
#include <QtCore/QRegExp>
#include <QtCore/QStack>
-
+#include <QDebug>
QString K3b::PatternParser::parsePattern( const KCDDB::CDInfo& entry,
int trackNumber,
@@ -126,6 +126,10 @@ QString K3b::PatternParser::parsePattern( const KCDDB::CDInfo& entry,
break;
case TITLE:
s = entry.track( trackNumber-1 ).get( KCDDB::Title ).toString();
+ s = s.trimmed(); // Remove whitespace from start and the end.
+#ifdef K3B_DEBUG
+ qDebug() << "DEBUG:" << __PRETTY_FUNCTION__ << s;
+#endif
s.replace( '/', '_' );
s.replace( '*', '_' );
s.replace( '}', '*' );