Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/image.cpp
Show First 20 Lines • Show All 763 Lines • ▼ Show 20 Line(s) | 760 | { | |||
---|---|---|---|---|---|
764 | int previousSlide = m_currentSlide; | 764 | int previousSlide = m_currentSlide; | ||
765 | QUrl previousPath = m_slideFilterModel->index(m_currentSlide, 0).data(BackgroundListModel::PathRole).toUrl(); | 765 | QUrl previousPath = m_slideFilterModel->index(m_currentSlide, 0).data(BackgroundListModel::PathRole).toUrl(); | ||
766 | if (m_currentSlide == m_slideFilterModel->rowCount() - 1 || m_currentSlide < 0) { | 766 | if (m_currentSlide == m_slideFilterModel->rowCount() - 1 || m_currentSlide < 0) { | ||
767 | m_currentSlide = 0; | 767 | m_currentSlide = 0; | ||
768 | } else { | 768 | } else { | ||
769 | m_currentSlide += 1; | 769 | m_currentSlide += 1; | ||
770 | } | 770 | } | ||
771 | //We are starting again - avoid having the same random order when we restart the slideshow | 771 | //We are starting again - avoid having the same random order when we restart the slideshow | ||
772 | if (m_slideshowMode == Random && previousSlide == m_slideFilterModel->rowCount() - 1) { | 772 | if (m_slideshowMode == Random && m_currentSlide == 0) { | ||
773 | m_slideFilterModel->invalidate(); | 773 | m_slideFilterModel->invalidate(); | ||
774 | } | 774 | } | ||
775 | QUrl next = m_slideFilterModel->index(m_currentSlide, 0).data(BackgroundListModel::PathRole).toUrl(); | 775 | QUrl next = m_slideFilterModel->index(m_currentSlide, 0).data(BackgroundListModel::PathRole).toUrl(); | ||
776 | // And avoid showing the same picture twice | 776 | // And avoid showing the same picture twice | ||
777 | if (previousSlide == m_slideFilterModel->rowCount() - 1 && previousPath == next && m_slideFilterModel->rowCount() > 1) { | 777 | if (previousSlide == m_slideFilterModel->rowCount() - 1 && previousPath == next && m_slideFilterModel->rowCount() > 1) { | ||
778 | m_currentSlide += 1; | 778 | m_currentSlide += 1; | ||
779 | next = m_slideFilterModel->index(m_currentSlide, 0).data(BackgroundListModel::PathRole).toUrl(); | 779 | next = m_slideFilterModel->index(m_currentSlide, 0).data(BackgroundListModel::PathRole).toUrl(); | ||
780 | } | 780 | } | ||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |