aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcollectionsorter.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/collectionsorter.cpp b/collectionsorter.cpp
index 7230491..5925acc 100755
--- a/collectionsorter.cpp
+++ b/collectionsorter.cpp
@@ -37,12 +37,9 @@ void CollectionSorter::setFilter(QString filter)
}
QModelIndex CollectionSorter::peekNext() const
{
- if(rowCount() == 0)
+ if(m_selected + 1 >= rowCount() || rowCount() == 0)
return QModelIndex();
- if(m_selected + 1 < rowCount()) {
- return index(m_selected + 1, 0);
- }
- return QModelIndex();
+ return index(m_selected + 1, 0);
}
QModelIndex CollectionSorter::moveNext()