aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2019-04-03 18:44:18 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2019-04-03 18:44:18 +0000
commit245027ffccb6dd722b1c928b0d53a62f095c466e (patch)
tree294413fcc3da4d6bec3b023995f94151cdbd32e4 /src/plugins
parentc5f29e360410f5f0de93e76282bbed9fcdbeca7e (diff)
downloadqmmp-245027ffccb6dd722b1c928b0d53a62f095c466e.tar.gz
qmmp-245027ffccb6dd722b1c928b0d53a62f095c466e.tar.bz2
qmmp-245027ffccb6dd722b1c928b0d53a62f095c466e.zip
streambrowser: add track with title and genre
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8769 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/General/streambrowser/streamwindow.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/General/streambrowser/streamwindow.cpp b/src/plugins/General/streambrowser/streamwindow.cpp
index c662b5ea0..504914025 100644
--- a/src/plugins/General/streambrowser/streamwindow.cpp
+++ b/src/plugins/General/streambrowser/streamwindow.cpp
@@ -179,14 +179,18 @@ void StreamWindow::on_updatePushButton_clicked()
void StreamWindow::on_addPushButton_clicked()
{
- QStringList urls;
+ QList<PlayListTrack *> tracks;
if(m_ui->tabWidget->currentIndex() == 0)
{
QModelIndexList indexes = m_ui->favoritesTableView->selectionModel()->selectedRows(0);
foreach(QModelIndex index, indexes)
{
QModelIndex source_index = m_favoritesFilterModel->mapToSource(index);
- urls.append(m_favoritesModel->item(source_index.row(),0)->data().toString());
+ tracks << new PlayListTrack();
+ tracks.last()->setPath(m_favoritesModel->item(source_index.row(),0)->data().toString());
+ tracks.last()->setValue(Qmmp::TITLE, m_favoritesModel->item(source_index.row(),0)->text());
+ tracks.last()->setValue(Qmmp::GENRE, m_favoritesModel->item(source_index.row(),1)->text());
+
}
}
else
@@ -195,11 +199,13 @@ void StreamWindow::on_addPushButton_clicked()
foreach(QModelIndex index, indexes)
{
QModelIndex source_index = m_iceCastFilterModel->mapToSource(index);
- urls.append(m_iceCastModel->item(source_index.row(),0)->data().toString());
+ tracks << new PlayListTrack();
+ tracks.last()->setPath(m_iceCastModel->item(source_index.row(),0)->data().toString());
+ tracks.last()->setValue(Qmmp::TITLE, m_iceCastModel->item(source_index.row(),0)->text());
+ tracks.last()->setValue(Qmmp::GENRE, m_iceCastModel->item(source_index.row(),1)->text());
}
}
- urls.removeDuplicates();
- PlayListManager::instance()->add(urls);
+ PlayListManager::instance()->add(tracks);
}
void StreamWindow::on_filterLineEdit_textChanged(const QString &text)