aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/cue
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2012-07-12 15:35:13 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2012-07-12 15:35:13 +0000
commit7dfd87d41c1992f4c9c99de1f4a848a116738a6e (patch)
tree08dcc1441a8c706483a5a610c67bbad86f1af4e2 /src/plugins/Input/cue
parent203e026e1249fa8139d6cd99c3894a6b7d743204 (diff)
downloadqmmp-7dfd87d41c1992f4c9c99de1f4a848a116738a6e.tar.gz
qmmp-7dfd87d41c1992f4c9c99de1f4a848a116738a6e.tar.bz2
qmmp-7dfd87d41c1992f4c9c99de1f4a848a116738a6e.zip
fixed incorrect cue parsing
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2788 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/cue')
-rw-r--r--src/plugins/Input/cue/cueparser.cpp11
-rw-r--r--src/plugins/Input/cue/cueparser.h2
2 files changed, 6 insertions, 7 deletions
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