aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-09-19 08:20:21 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-09-19 08:20:21 +0000
commit18b1a7a93b6d9c52c386fa92226140cf73520f6c (patch)
treedaecc71c247e7f16973e4185d3d6ee3ec8a78f55 /src
parent85cae67a539120d88537b808f4b77b651d160d2b (diff)
downloadqmmp-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')
-rw-r--r--src/qmmpui/playlistmodel.cpp9
-rw-r--r--src/qmmpui/playlistmodel.h1
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;
};