diff --git a/PlaylistList.cpp b/PlaylistList.cpp index f588b3d..4b2ec09 100644 --- a/PlaylistList.cpp +++ b/PlaylistList.cpp @@ -103,11 +103,17 @@ PlaylistList::playlistChanged (QHash h) { int pos = h.value("position").toUInt(); PlaylistItem *i = m_items->value (pos); + if (!i) { return; } + m_items->removeAt (pos); - m_itemmap->remove (i->getID ()); + if (!m_items->contains (i)) { + m_itemmap->remove (i->getID ()); + delete i; + } + if (m_active) { if (m_active > pos) { m_active --; @@ -116,7 +122,6 @@ PlaylistList::playlistChanged (QHash h) } } - delete i; } break; case XMMS_PLAYLIST_CHANGED_MOVE: @@ -397,8 +402,7 @@ PlaylistList::keyPressEvent (QKeyEvent *event) { /* Sort list and remove in reverse order */ qSort (*m_selected); - for (int i = m_selected->count (); i > 0; i --) { - qDebug ("delete pos %d", m_selected->value (i)); + for (int i = m_selected->count () - 1; i >= 0; i --) { xmmsh->playlistRemove (m_selected->value (i)); } m_selected->clear (); diff --git a/promoe.pro b/promoe.pro index ed4bc17..99842a6 100644 --- a/promoe.pro +++ b/promoe.pro @@ -43,7 +43,8 @@ RESOURCES = promoe.qrc macx:RC_FILE = promoe.icns CONFIG += link_pkgconfig -CONFIG += debug warn_on +CXXFLAGS += -g +;CONFIG += debug warn_on QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter PKGCONFIG += xmms2-client xmms2-client-cpp sigc++-2.0