diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-09-19 08:20:21 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-09-19 08:20:21 +0000 |
| commit | 18b1a7a93b6d9c52c386fa92226140cf73520f6c (patch) | |
| tree | daecc71c247e7f16973e4185d3d6ee3ec8a78f55 /src/qmmpui/playlistmodel.cpp | |
| parent | 85cae67a539120d88537b808f4b77b651d160d2b (diff) | |
| download | qmmp-18b1a7a93b6d9c52c386fa92226140cf73520f6c.tar.gz qmmp-18b1a7a93b6d9c52c386fa92226140cf73520f6c.tar.bz2 qmmp-18b1a7a93b6d9c52c386fa92226140cf73520f6c.zip | |
update current index for grouped container while adding new tracks
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3716 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistmodel.cpp')
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index ef77e72a4..853527c69 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -40,10 +40,11 @@ PlayListModel::PlayListModel(const QString &name, QObject *parent) { qsrand(time(0)); m_name = name; - m_shuffle = 0; + m_shuffle = false; m_total_length = 0; m_current = 0; m_is_repeatable_list = false; + m_groups_enabled = false; m_stop_track = 0; m_play_state = new NormalPlayState(this); m_loader = new FileLoader(this); @@ -88,6 +89,11 @@ void PlayListModel::add(PlayListTrack *track) m_current = m_container->indexOf(track); emit currentChanged(); } + else if(m_groups_enabled) + { + //update current index for grouped container only + m_current = m_container->indexOf(m_current_track); + } emit itemAdded(track); emit listChanged(); emit countChanged(); @@ -699,6 +705,7 @@ void PlayListModel::prepareGroups(bool enabled) m_container = container; if(!m_container->isEmpty()) m_current = m_container->indexOf(m_current_track); + m_groups_enabled = enabled; emit listChanged(); } |
