From 7dfd87d41c1992f4c9c99de1f4a848a116738a6e Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 12 Jul 2012 15:35:13 +0000 Subject: fixed incorrect cue parsing git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2788 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/cue/cueparser.cpp | 11 +++++------ src/plugins/Input/cue/cueparser.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Input/cue/cueparser.cpp b/src/plugins/Input/cue/cueparser.cpp index 581acf80b..713c9742f 100644 --- a/src/plugins/Input/cue/cueparser.cpp +++ b/src/plugins/Input/cue/cueparser.cpp @@ -286,10 +286,9 @@ qint64 CUEParser::getLength(const QString &str) return 0; } -QString CUEParser::getDirtyPath(const QString &cue, const QString &path) +QString CUEParser::getDirtyPath(const QString &cue_path, const QString &path) { - - if (Decoder::findByPath(path) || !m_dirty) + if((QFile::exists(path) && Decoder::findByPath(path)) || !m_dirty) return path; QStringList candidates; @@ -298,7 +297,7 @@ QString CUEParser::getDirtyPath(const QString &cue, const QString &path) { it.next(); QString f = it.filePath(); - if ((f != cue) && Decoder::findByPath(f)) + if ((f != cue_path) && Decoder::findByPath(f)) candidates.push_back(f); } @@ -307,10 +306,10 @@ QString CUEParser::getDirtyPath(const QString &cue, const QString &path) else if (candidates.count() == 1) return candidates.first(); - int dot = cue.lastIndexOf('.'); + int dot = cue_path.lastIndexOf('.'); if (dot != -1) { - QRegExp r(QRegExp::escape(cue.left(dot)) + "\\.[^\\.]+$"); + QRegExp r(QRegExp::escape(cue_path.left(dot)) + "\\.[^\\.]+$"); int index = candidates.indexOf(r); int rindex = candidates.lastIndexOf(r); diff --git a/src/plugins/Input/cue/cueparser.h b/src/plugins/Input/cue/cueparser.h index c4ecf2427..aeb7f0356 100644 --- a/src/plugins/Input/cue/cueparser.h +++ b/src/plugins/Input/cue/cueparser.h @@ -59,7 +59,7 @@ private: bool m_dirty; QStringList splitLine(const QString &line); qint64 getLength(const QString &str); - QString getDirtyPath(const QString &cue, const QString &path); + QString getDirtyPath(const QString &cue_path, const QString &path); }; #endif -- cgit v1.2.3-13-gbd6f