diff options
Diffstat (limited to 'src/qmmpui')
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 9 | ||||
| -rw-r--r-- | src/qmmpui/playlistmodel.h | 1 |
2 files changed, 9 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(); } diff --git a/src/qmmpui/playlistmodel.h b/src/qmmpui/playlistmodel.h index 9b377d20d..8c0309bca 100644 --- a/src/qmmpui/playlistmodel.h +++ b/src/qmmpui/playlistmodel.h @@ -453,6 +453,7 @@ private: int m_total_length; FileLoader *m_loader; bool m_shuffle; + bool m_groups_enabled; QString m_name; PlayListContainer *m_container; }; |
