diff options
author | Arno <arno@disconnect.de> | 2017-08-26 08:04:07 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2017-08-26 08:04:07 +0200 |
commit | e38a221858d932aab81e04c5a95188a3e705ed12 (patch) | |
tree | 8c65edc749e8434d42a03345e2c5328fb483ce8e /playerwidget.cpp | |
parent | 1285456abe4be9a22dc42498a1d0a1a43a0a00be (diff) | |
download | BeetPlayer-e38a221858d932aab81e04c5a95188a3e705ed12.tar.gz BeetPlayer-e38a221858d932aab81e04c5a95188a3e705ed12.tar.bz2 BeetPlayer-e38a221858d932aab81e04c5a95188a3e705ed12.zip |
Play the doubleClicked url
Shit, it worked on the first attempt!
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r-- | playerwidget.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp index 37c6d5c..3dd8b87 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -811,6 +811,11 @@ void PlayerWidget::viewDoubleClicked(const QModelIndex &idx){ addToPlayList(); return; } + if(model == mWebRadioModel){ + QString url(idx.data(UrlRole).toString()); + playUrl(url); + return; + } QString fp(idx.data(FullPathRole).toString()); QFileInfo fi(fp); if(fi.isDir()){ @@ -1391,6 +1396,11 @@ void PlayerWidget::play(const QString &fullPath){ emit playModeChanged(tr("Playing")); } +void PlayerWidget::playUrl(const QString &url){ + mPlayer->setMedia(QUrl(url)); + mPlayer->play(); +} + void PlayerWidget::volumeChanged(int volume){ QString s = QString("%1 %").arg(volume, 3, 10, QChar('0')); mVolumePos->setText(s); |