diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2008-06-10 18:26:27 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2008-06-10 18:26:27 -0400 |
commit | 074d444b5a41de6e404384d71bc4ca6c0b600f67 (patch) | |
tree | 2a5c51b41ba762872755b73e9632a36719c2fa91 | |
parent | Added copyrights. (diff) | |
download | zmusicplayer-074d444b5a41de6e404384d71bc4ca6c0b600f67.tar.xz zmusicplayer-074d444b5a41de6e404384d71bc4ca6c0b600f67.zip |
Cleaned up peek code.
-rwxr-xr-x | collectionsorter.cpp | 7 |
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() |