From 41b4eec3f4fc4c1ba63211c2af7680acfc723bdd Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 17 Feb 2009 15:18:41 +0000 Subject: fixed url dialog bug git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@793 90c681e8-e032-0410-971d-27865f9a5e38 --- src/ui/addurldialog.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/ui/addurldialog.cpp') diff --git a/src/ui/addurldialog.cpp b/src/ui/addurldialog.cpp index 404c08d06..542044f66 100644 --- a/src/ui/addurldialog.cpp +++ b/src/ui/addurldialog.cpp @@ -40,8 +40,6 @@ 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(done (bool)), SLOT(readResponse(bool))); - //load global proxy settings if (Qmmp::useProxy()) m_http->setProxy(Qmmp::proxy().host(), @@ -91,6 +89,7 @@ void AddUrlDialog::accept( ) //download playlist; QUrl url(s); m_http->setHost(url.host(), url.port(80)); + connect(m_http, SIGNAL(done (bool)), SLOT(readResponse(bool))); m_http->get(url.path()); addButton->setEnabled(FALSE); return; @@ -103,16 +102,19 @@ void AddUrlDialog::accept( ) void AddUrlDialog::readResponse(bool error) { + disconnect(m_http, SIGNAL(done (bool))); if (error) QMessageBox::critical (this, tr("Error"), m_http->errorString ()); - else + else if (!urlComboBox->currentText().isEmpty()) { QString s = urlComboBox->currentText(); PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s); if (prs) + { m_model->addFiles(prs->decode(m_http->readAll())); + QDialog::accept(); + } } - QDialog::accept(); } void AddUrlDialog::setModel( PlayListModel *m ) -- cgit v1.2.3-13-gbd6f