From 815f56f3f3974b1c5f9af8f1fd12ae411b7c54fe Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 22 Feb 2009 22:57:35 +0000 Subject: fixed invalid file handling git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@804 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmp/soundcore.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/qmmp/soundcore.cpp b/src/qmmp/soundcore.cpp index 9eafb557d..f5225b1d3 100644 --- a/src/qmmp/soundcore.cpp +++ b/src/qmmp/soundcore.cpp @@ -83,10 +83,16 @@ bool SoundCore::play(const QString &source) m_handler->dispatch(Qmmp::Buffering); //buffering state QUrl url; - if (QFile::exists(source)) //local file + if (source.contains("://")) //url + url = source; + else if (QFile::exists(source)) url = QUrl::fromLocalFile(source); else - url = source; + { + qDebug("SoundCore: file doesn't exist"); + m_handler->dispatch(Qmmp::NormalError); + return FALSE; + } m_factory = Decoder::findByURL(url); if (m_factory) -- cgit v1.2.3-13-gbd6f