Commit faf5e09f authored by Michael Pyne's avatar Michael Pyne
Browse files

Make the history playlist work again.

In the great PlayerManager de-singletonizing of KDE 4.1 I managed to not port over the
Qt signal for the playlist splitter that was emitted on track change, which meant the
history playlist wouldn't receive it. I've reattached the signal to the history playlist
which means it works[1] again.

[1] It's still as broken as it was in KDE 4.0, which means that the "Date" column doesn't
show up, and all the other columns are shifted over by one to compensate.

BUG: 168998
FIXED-IN: 4.5

svn path=/trunk/KDE/kdemultimedia/juk/; revision=1136884
parent 38fcd378
......@@ -62,9 +62,9 @@ using namespace ActionCollection;
// PlaylistBox public methods
////////////////////////////////////////////////////////////////////////////////
PlaylistBox::PlaylistBox(QWidget *parent, QStackedWidget *playlistStack) :
PlaylistBox::PlaylistBox(PlayerManager *player, QWidget *parent, QStackedWidget *playlistStack) :
K3ListView(parent),
PlaylistCollection(playlistStack),
PlaylistCollection(player, playlistStack),
m_viewModeIndex(0),
m_hasSelection(false),
m_doingMultiSelect(false),
......@@ -253,10 +253,6 @@ void PlaylistBox::slotPlaylistDataChanged()
void PlaylistBox::slotSetHistoryPlaylistEnabled(bool enable)
{
setHistoryPlaylistEnabled(enable);
if(enable) {
connect(this, SIGNAL(playingItemChanged(FileHandle)),
historyPlaylist(), SLOT(appendProposedItem(FileHandle)));
}
}
void PlaylistBox::setupPlaylist(Playlist *playlist, const QString &iconName)
......
......@@ -48,7 +48,7 @@ public:
friend class Item;
PlaylistBox(QWidget *parent, QStackedWidget *playlistStack);
PlaylistBox(PlayerManager *player, QWidget *parent, QStackedWidget *playlistStack);
virtual ~PlaylistBox();
virtual void raise(Playlist *playlist);
......
......@@ -68,10 +68,11 @@ PlaylistCollection *PlaylistCollection::m_instance = 0;
// public methods
////////////////////////////////////////////////////////////////////////////////
PlaylistCollection::PlaylistCollection(QStackedWidget *playlistStack) :
PlaylistCollection::PlaylistCollection(PlayerManager *player, QStackedWidget *playlistStack) :
m_playlistStack(playlistStack),
m_historyPlaylist(0),
m_upcomingPlaylist(0),
m_playerManager(player),
m_importPlaylists(true),
m_searchEnabled(true),
m_playing(false),
......@@ -556,6 +557,9 @@ void PlaylistCollection::setHistoryPlaylistEnabled(bool enable)
m_historyPlaylist = new HistoryPlaylist(this);
m_historyPlaylist->setName(i18n("History"));
setupPlaylist(m_historyPlaylist, "view-history");
QObject::connect(m_playerManager, SIGNAL(signalItemChanged(FileHandle)),
historyPlaylist(), SLOT(appendProposedItem(FileHandle)));
}
else {
delete m_historyPlaylist;
......
......@@ -35,6 +35,7 @@ class SearchPlaylist;
class DynamicPlaylist;
class PlaylistItem;
class Playlist;
class PlayerManager;
template<class T>
class QList;
......@@ -49,7 +50,7 @@ class PlaylistCollection : public PlaylistInterface
friend class DynamicPlaylist;
public:
PlaylistCollection(QStackedWidget *playlistStack);
PlaylistCollection(PlayerManager *player, QStackedWidget *playlistStack);
virtual ~PlaylistCollection();
static PlaylistCollection *instance() { return m_instance; }
......@@ -188,6 +189,7 @@ private:
HistoryPlaylist *m_historyPlaylist;
UpcomingPlaylist *m_upcomingPlaylist;
ActionHandler *m_actionHandler;
PlayerManager *m_playerManager;
KDirLister m_dirLister;
StringHash m_playlistNames;
......
......@@ -64,9 +64,6 @@ PlaylistSplitter::PlaylistSplitter(PlayerManager *player, QWidget *parent) :
m_editor->slotUpdateCollection();
m_editor->setupObservers();
connect(m_player, SIGNAL(signalItemChanged(FileHandle)),
this, SIGNAL(playingItemChanged(FileHandle)));
}
PlaylistSplitter::~PlaylistSplitter()
......@@ -194,7 +191,7 @@ void PlaylistSplitter::setupLayout()
// Create the PlaylistBox
m_playlistBox = new PlaylistBox(this, m_playlistStack);
m_playlistBox = new PlaylistBox(m_player, this, m_playlistStack);
m_playlistBox->setObjectName( "playlistBox" );
connect(m_playlistBox->object(), SIGNAL(signalSelectedItemsChanged()),
......
......@@ -58,8 +58,6 @@ signals:
*/
void guiReady();
void playingItemChanged(const FileHandle &file);
public slots:
virtual void setFocus();
virtual void slotFocusCurrentPlaylist();
......
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