diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-11-03 14:52:51 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-11-03 14:52:51 +0000 |
| commit | eeffcb5f6362ca76c3e35b813d956f4f11a86d9d (patch) | |
| tree | 23dce8727193e89cd4bbb2d29783615ba758d52b | |
| parent | 37093983fe3816d6a5a53618467ade5245580271 (diff) | |
| download | qmmp-eeffcb5f6362ca76c3e35b813d956f4f11a86d9d.tar.gz qmmp-eeffcb5f6362ca76c3e35b813d956f4f11a86d9d.tar.bz2 qmmp-eeffcb5f6362ca76c3e35b813d956f4f11a86d9d.zip | |
fixed playlist model
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2485 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/Ui/skinned/listwidget.h | 1 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/playlist.cpp | 3 | ||||
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 10 | ||||
| -rw-r--r-- | src/qmmpui/playlistmodel.h | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/Ui/skinned/listwidget.h b/src/plugins/Ui/skinned/listwidget.h index 7e901d34f..2535c60a5 100644 --- a/src/plugins/Ui/skinned/listwidget.h +++ b/src/plugins/Ui/skinned/listwidget.h @@ -75,6 +75,7 @@ public: void setAnchorRow(int r) { m_anchor_row = r; + update(); } QMenu *menu() diff --git a/src/plugins/Ui/skinned/playlist.cpp b/src/plugins/Ui/skinned/playlist.cpp index 0880becda..079ddac86 100644 --- a/src/plugins/Ui/skinned/playlist.cpp +++ b/src/plugins/Ui/skinned/playlist.cpp @@ -508,8 +508,7 @@ void PlayList::showPlaylistMenu() void PlayList::keyPressEvent (QKeyEvent *ke) { - if (m_keyboardManager->handleKeyPress (ke)) - update(); + m_keyboardManager->handleKeyPress (ke); } void PlayList::updateSkin() diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index e99cd835e..0f158fec6 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -310,10 +310,13 @@ bool PlayListModel::contains(const QString &url) return false; } -void PlayListModel::setSelected(int row, bool yes) +void PlayListModel::setSelected(int row, bool selected) { if (m_items.count() > row && row >= 0) - m_items.at(row)->setSelected(yes); + { + m_items.at(row)->setSelected(selected); + emit listChanged(); + } } void PlayListModel::removeSelected() @@ -402,7 +405,8 @@ void PlayListModel::removeSelection(bool inverted) if (select_after_delete >= m_items.count()) select_after_delete = m_items.count() - 1; - setSelected(select_after_delete,true); + if(select_after_delete != -1) + m_items.at(select_after_delete)->setSelected(true); m_play_state->prepare(); diff --git a/src/qmmpui/playlistmodel.h b/src/qmmpui/playlistmodel.h index 190a0c78a..26ed7ddcd 100644 --- a/src/qmmpui/playlistmodel.h +++ b/src/qmmpui/playlistmodel.h @@ -165,7 +165,7 @@ public: * @param row Number of item. * @param select Selection state (\b true - select, \b false - unselect) */ - void setSelected(int row, bool select); + void setSelected(int row, bool selected = true); /*! * Advances to the next item. Returns \b false if next iten doesn't exist, * otherwise returns \b true |
