diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-06-04 09:51:40 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-06-04 09:51:40 +0000 |
| commit | a4da0eb5e46e178d34a848b5fdb76dd8453510cd (patch) | |
| tree | 57edc1f26bfd1f58dcad71933aa5383b08e1d262 /src/ui/addurldialog.cpp | |
| parent | 5a1055301b485554ade9ce0555105cef4a58f50d (diff) | |
| download | qmmp-a4da0eb5e46e178d34a848b5fdb76dd8453510cd.tar.gz qmmp-a4da0eb5e46e178d34a848b5fdb76dd8453510cd.tar.bz2 qmmp-a4da0eb5e46e178d34a848b5fdb76dd8453510cd.zip | |
moved playlist formats support to plugins
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@397 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/addurldialog.cpp')
| -rw-r--r-- | src/ui/addurldialog.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/ui/addurldialog.cpp b/src/ui/addurldialog.cpp index fd460ba01..3ace76065 100644 --- a/src/ui/addurldialog.cpp +++ b/src/ui/addurldialog.cpp @@ -24,7 +24,8 @@ #include <QUrl> #include <QMessageBox> #include "addurldialog.h" -#include "playlistformat.h" +#include <qmmpui/playlistparser.h> +#include <qmmpui/playlistformat.h> #include "playlistmodel.h" #define HISTORY_SIZE 10 @@ -74,18 +75,15 @@ void AddUrlDialog::accept( ) s.prepend("http://"); m_history.removeAll(s); m_history.prepend(s); - //TODO this code should be removed - foreach(PlaylistFormat* prs, m_model->registeredPlaylistFormats()) + PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s); + if (prs) { - if (prs->hasFormat(QFileInfo(s).suffix().toLower())) - { - //download playlist; - QUrl url(s); - m_http->setHost(url.host(), url.port(80)); - m_http->get(url.path()); //TODO proxy support - addButton->setEnabled(FALSE); - return; - } + //download playlist; + QUrl url(s); + m_http->setHost(url.host(), url.port(80)); + m_http->get(url.path()); //TODO proxy support + addButton->setEnabled(FALSE); + return; } m_model->addFile(s); } @@ -104,13 +102,11 @@ void AddUrlDialog::processResponse(int, bool error) void AddUrlDialog::readResponse(const QHttpResponseHeader&) { QString s = urlComboBox->currentText(); - foreach(PlaylistFormat* prs, m_model->registeredPlaylistFormats()) + PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s); + if (prs) { - if (prs->hasFormat(QFileInfo(s).suffix().toLower())) - { - m_model->addFiles(prs->decode(m_http->readAll())); - break; - } + m_model->addFiles(prs->decode(m_http->readAll())); + return; } QDialog::accept(); } |
