aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qmmpui/groupedcontainer.cpp2
-rw-r--r--src/qmmpui/normalcontainer.cpp2
-rw-r--r--src/qmmpui/playstate.cpp4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/qmmpui/groupedcontainer.cpp b/src/qmmpui/groupedcontainer.cpp
index c30b08fce..52f86a301 100644
--- a/src/qmmpui/groupedcontainer.cpp
+++ b/src/qmmpui/groupedcontainer.cpp
@@ -128,7 +128,7 @@ PlayListItem *GroupedContainer::item(int index) const
{
if(index >= count() || index < 0)
{
- qWarning("PlayListItem: index is out of range");
+ qWarning("GroupedContainer: index is out of range");
return 0;
}
return m_items.at(index);
diff --git a/src/qmmpui/normalcontainer.cpp b/src/qmmpui/normalcontainer.cpp
index 9a939f83b..1be508521 100644
--- a/src/qmmpui/normalcontainer.cpp
+++ b/src/qmmpui/normalcontainer.cpp
@@ -95,7 +95,7 @@ PlayListItem *NormalContainer::item(int index) const
{
if(index >= count() || index < 0)
{
- qWarning("PlayListItem: index is out of range");
+ qWarning("NormalContainer index is out of range");
return 0;
}
return m_items.at(index);
diff --git a/src/qmmpui/playstate.cpp b/src/qmmpui/playstate.cpp
index 1cd44b72d..f16f4c85c 100644
--- a/src/qmmpui/playstate.cpp
+++ b/src/qmmpui/playstate.cpp
@@ -120,7 +120,9 @@ bool NormalPlayState::next()
return false;
}
- if(m_model->track((m_model->currentIndex() + 1)))
+ if(m_model->currentIndex() + 1 >= m_model->count())
+ return false;
+ else if(m_model->track((m_model->currentIndex() + 1)))
return m_model->setCurrent(m_model->currentIndex() + 1);
else if(m_model->currentIndex() + 2 > m_model->count() - 1)
return false;