diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-02-17 15:18:41 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-02-17 15:18:41 +0000 |
| commit | 41b4eec3f4fc4c1ba63211c2af7680acfc723bdd (patch) | |
| tree | cbc93ec0230ee7a49a27e6d91cd667d66c2e1c1a | |
| parent | b553badd6c3ebb5b6932ed5150f859592bbec6d8 (diff) | |
| download | qmmp-41b4eec3f4fc4c1ba63211c2af7680acfc723bdd.tar.gz qmmp-41b4eec3f4fc4c1ba63211c2af7680acfc723bdd.tar.bz2 qmmp-41b4eec3f4fc4c1ba63211c2af7680acfc723bdd.zip | |
fixed url dialog bug
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@793 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/ui/addurldialog.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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 ) |
