aboutsummaryrefslogtreecommitdiff
path: root/src/ui/addurldialog.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-02-05 15:18:57 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-02-05 15:18:57 +0000
commitd87fcd42cded162669b7b3896f4e7c4d29d46917 (patch)
treee2adba391e377d89a6e09f1a53b282f7fa1ae035 /src/ui/addurldialog.cpp
parente662c2f44050ad66b56e5c2321e7a20b57ed628f (diff)
downloadqmmp-d87fcd42cded162669b7b3896f4e7c4d29d46917.tar.gz
qmmp-d87fcd42cded162669b7b3896f4e7c4d29d46917.tar.bz2
qmmp-d87fcd42cded162669b7b3896f4e7c4d29d46917.zip
fixed large playlist downloading
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@775 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/addurldialog.cpp')
-rw-r--r--src/ui/addurldialog.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/ui/addurldialog.cpp b/src/ui/addurldialog.cpp
index 38aa3cab3..92aae7820 100644
--- a/src/ui/addurldialog.cpp
+++ b/src/ui/addurldialog.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006-2008 by Ilya Kotov *
+ * Copyright (C) 2006-2009 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -40,9 +40,7 @@ AddUrlDialog::AddUrlDialog( QWidget * parent, Qt::WindowFlags f) : QDialog(paren
m_history = settings.value("URLDialog/history").toStringList();
urlComboBox->addItems(m_history);
m_http = new QHttp(this);
- connect(m_http, SIGNAL(requestFinished (int, bool)), SLOT(processResponse(int, bool)));
- connect(m_http, SIGNAL(readyRead (const QHttpResponseHeader&)),
- SLOT(readResponse(const QHttpResponseHeader&)));
+ connect(m_http, SIGNAL(done (bool)), SLOT(readResponse(bool)));
//use global proxy settings
if (settings.value ("Proxy/use_proxy", FALSE).toBool())
@@ -92,7 +90,8 @@ void AddUrlDialog::accept( )
m_history.prepend(s);
if (s.startsWith("http://"))
- { //try to download playlist
+ {
+ //try to download playlist
PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s);
if (prs)
{
@@ -109,23 +108,16 @@ void AddUrlDialog::accept( )
QDialog::accept();
}
-void AddUrlDialog::processResponse(int, bool error)
+void AddUrlDialog::readResponse(bool error)
{
if (error)
- {
QMessageBox::critical (this, tr("Error"), m_http->errorString ());
- QDialog::accept();
- }
-}
-
-void AddUrlDialog::readResponse(const QHttpResponseHeader&)
-{
- QString s = urlComboBox->currentText();
- PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s);
- if (prs)
+ else
{
- m_model->addFiles(prs->decode(m_http->readAll()));
- return;
+ QString s = urlComboBox->currentText();
+ PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s);
+ if (prs)
+ m_model->addFiles(prs->decode(m_http->readAll()));
}
QDialog::accept();
}