Commit 7e5183c8 authored by Scott Wheeler's avatar Scott Wheeler

Don't crash if the currently playing playlist is removed.

svn path=/trunk/kdemultimedia/juk/; revision=317468
parent f946c053
...@@ -357,7 +357,8 @@ Playlist::Playlist(PlaylistCollection *collection, bool delaySetup) : ...@@ -357,7 +357,8 @@ Playlist::Playlist(PlaylistCollection *collection, bool delaySetup) :
Playlist::~Playlist() Playlist::~Playlist()
{ {
if(m_playingItem && m_playingItem->playlist() == this)
m_playingItem = 0;
} }
QString Playlist::name() const QString Playlist::name() const
......
...@@ -137,6 +137,7 @@ void TagEditor::slotSetItems(const PlaylistItemList &list) ...@@ -137,6 +137,7 @@ void TagEditor::slotSetItems(const PlaylistItemList &list)
if(m_currentPlaylist) { if(m_currentPlaylist) {
connect(m_currentPlaylist, SIGNAL(signalAboutToRemove(PlaylistItem *)), connect(m_currentPlaylist, SIGNAL(signalAboutToRemove(PlaylistItem *)),
this, SLOT(slotItemRemoved(PlaylistItem *))); this, SLOT(slotItemRemoved(PlaylistItem *)));
connect(m_currentPlaylist, SIGNAL(destroyed()), this, SLOT(slotPlaylistRemoved()));
} }
m_items = list; m_items = list;
......
...@@ -76,6 +76,7 @@ private: ...@@ -76,6 +76,7 @@ private:
private slots: private slots:
void slotDataChanged(bool c = true); void slotDataChanged(bool c = true);
void slotItemRemoved(PlaylistItem *item); void slotItemRemoved(PlaylistItem *item);
void slotPlaylistRemoved() { m_currentPlaylist = 0; }
private: private:
typedef QMap<QWidget *, QCheckBox *> BoxMap; typedef QMap<QWidget *, QCheckBox *> BoxMap;
......
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