Commit 10009ea4 authored by Michael Pyne's avatar Michael Pyne

The change to PlaylistBox::currentPlaylist() to support keeping the playing...

The change to PlaylistBox::currentPlaylist() to support keeping the playing playlist in the status bar has caused too many problems, so revert that and add the support directly to StatusLabel.

Unfortunately it is a hack, but it has the virtue of working, and of fixing bug 90607.

CCMAIL:90607-done@bugs.kde.org

svn path=/trunk/kdemultimedia/juk/; revision=351037
parent 80df4906
...@@ -221,9 +221,7 @@ Playlist *PlaylistBox::currentPlaylist() const ...@@ -221,9 +221,7 @@ Playlist *PlaylistBox::currentPlaylist() const
if(m_dynamicPlaylist) if(m_dynamicPlaylist)
return m_dynamicPlaylist; return m_dynamicPlaylist;
if(Playlist::playingItem()) if(currentItem() && static_cast<Item *>(currentItem())->playlist())
return Playlist::playingItem()->playlist();
else if(currentItem() && static_cast<Item *>(currentItem())->playlist())
return static_cast<Item *>(currentItem())->playlist(); return static_cast<Item *>(currentItem())->playlist();
else else
return PlaylistCollection::currentPlaylist(); return PlaylistCollection::currentPlaylist();
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "playlistinterface.h" #include "playlistinterface.h"
#include "actioncollection.h" #include "actioncollection.h"
#include "tag.h" #include "tag.h"
#include "playlist.h"
#include "playlistitem.h"
using namespace ActionCollection; using namespace ActionCollection;
...@@ -99,10 +101,16 @@ StatusLabel::~StatusLabel() ...@@ -99,10 +101,16 @@ StatusLabel::~StatusLabel()
void StatusLabel::updateCurrent() void StatusLabel::updateCurrent()
{ {
kdDebug(65432) << k_funcinfo << endl; //kdDebug(65432) << k_funcinfo << endl;
if(playlist()->playing()) { // Use a hack to always show the currently playing playlist in the status
FileHandle file = playlist()->currentFile(); // bar. We can't change PlaylistBox::currentPlaylist() to do this as that
// has too many sideeffects at this point.
if(Playlist::playingItem()) {
PlaylistInterface *playlist = Playlist::playingItem()->playlist();
FileHandle file = playlist->currentFile();
QString mid = file.tag()->artist().isEmpty() || file.tag()->title().isEmpty() QString mid = file.tag()->artist().isEmpty() || file.tag()->title().isEmpty()
? QString::null : QString(" - "); ? QString::null : QString(" - ");
...@@ -110,7 +118,7 @@ void StatusLabel::updateCurrent() ...@@ -110,7 +118,7 @@ void StatusLabel::updateCurrent()
QString text = file.tag()->artist() + mid + file.tag()->title(); QString text = file.tag()->artist() + mid + file.tag()->title();
m_trackLabel->setText(text); m_trackLabel->setText(text);
m_playlistLabel->setText(playlist()->name().simplifyWhiteSpace()); m_playlistLabel->setText(playlist->name().simplifyWhiteSpace());
} }
else else
updateData(); updateData();
...@@ -118,7 +126,7 @@ void StatusLabel::updateCurrent() ...@@ -118,7 +126,7 @@ void StatusLabel::updateCurrent()
void StatusLabel::updateData() void StatusLabel::updateData()
{ {
kdDebug(65432) << k_funcinfo << endl; //kdDebug(65432) << k_funcinfo << endl;
if(!playlist()->playing()) { if(!playlist()->playing()) {
setItemTotalTime(0); setItemTotalTime(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment