Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/image.cpp
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | |||||
102 | { | 102 | { | ||
103 | // don't bother loading single image until all properties have settled | 103 | // don't bother loading single image until all properties have settled | ||
104 | // otherwise we would load a too small image (initial view size) just | 104 | // otherwise we would load a too small image (initial view size) just | ||
105 | // to load the proper one afterwards etc etc | 105 | // to load the proper one afterwards etc etc | ||
106 | m_ready = true; | 106 | m_ready = true; | ||
107 | if (m_mode == SingleImage) { | 107 | if (m_mode == SingleImage) { | ||
108 | setSingleImage(); | 108 | setSingleImage(); | ||
109 | } else if (m_mode == SlideShow) { | 109 | } else if (m_mode == SlideShow) { | ||
110 | // show the last image shown the last time | ||||
111 | m_wallpaperPath = m_wallpaper; | ||||
112 | emit wallpaperPathChanged(); | ||||
110 | startSlideshow(); | 113 | startSlideshow(); | ||
111 | } | 114 | } | ||
112 | } | 115 | } | ||
113 | 116 | | |||
114 | QString Image::photosPath() const | 117 | QString Image::photosPath() const | ||
115 | { | 118 | { | ||
116 | return QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); | 119 | return QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); | ||
117 | } | 120 | } | ||
▲ Show 20 Lines • Show All 544 Lines • ▼ Show 20 Line(s) | 658 | { | |||
662 | } | 665 | } | ||
663 | 666 | | |||
664 | // start slideshow | 667 | // start slideshow | ||
665 | if (m_slideFilterModel->rowCount() == 0) { | 668 | if (m_slideFilterModel->rowCount() == 0) { | ||
666 | // no image has been found, which is quite weird... try again later (this is useful for events which | 669 | // no image has been found, which is quite weird... try again later (this is useful for events which | ||
667 | // are not detected by KDirWatch, like a NFS directory being mounted) | 670 | // are not detected by KDirWatch, like a NFS directory being mounted) | ||
668 | QTimer::singleShot(1000, this, &Image::startSlideshow); | 671 | QTimer::singleShot(1000, this, &Image::startSlideshow); | ||
669 | } else { | 672 | } else { | ||
670 | if (m_currentSlide == -1 && m_slideshowMode != Random) { | 673 | if (m_currentSlide == -1) { | ||
671 | m_currentSlide = m_slideFilterModel->indexOf(m_wallpaper) - 1; | 674 | m_currentSlide = m_slideFilterModel->indexOf(m_wallpaper) - 1; | ||
672 | } else { | 675 | } else { | ||
673 | m_currentSlide = -1; | 676 | m_currentSlide = -1; | ||
674 | } | 677 | } | ||
675 | m_slideFilterModel->sort(0); | 678 | m_slideFilterModel->sort(0); | ||
676 | nextSlide(); | 679 | nextSlide(); | ||
677 | m_timer.start(m_delay * 1000); | 680 | m_timer.start(m_delay * 1000); | ||
678 | } | 681 | } | ||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |