Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/image.cpp
Show First 20 Lines • Show All 614 Lines • ▼ Show 20 Line(s) | 610 | { | |||
---|---|---|---|---|---|
615 | m_findToken.clear(); | 615 | m_findToken.clear(); | ||
616 | 616 | | |||
617 | if(m_scanDirty) { | 617 | if(m_scanDirty) { | ||
618 | m_scanDirty = false; | 618 | m_scanDirty = false; | ||
619 | startSlideshow(); | 619 | startSlideshow(); | ||
620 | return; | 620 | return; | ||
621 | } | 621 | } | ||
622 | m_slideshowBackgrounds = paths; | 622 | m_slideshowBackgrounds = paths; | ||
623 | for(const QString &slide : qAsConst(m_uncheckedSlides)) { | ||||
624 | m_slideshowBackgrounds.removeAll(QUrl(slide).path()); | ||||
625 | } | ||||
623 | m_unseenSlideshowBackgrounds.clear(); | 626 | m_unseenSlideshowBackgrounds.clear(); | ||
624 | // start slideshow | 627 | // start slideshow | ||
625 | if (m_slideshowBackgrounds.isEmpty()) { | 628 | if (m_slideshowBackgrounds.isEmpty()) { | ||
626 | // no image has been found, which is quite weird... try again later (this is useful for events which | 629 | // no image has been found, which is quite weird... try again later (this is useful for events which | ||
627 | // are not detected by KDirWatch, like a NFS directory being mounted) | 630 | // are not detected by KDirWatch, like a NFS directory being mounted) | ||
628 | QTimer::singleShot(1000, this, &Image::startSlideshow); | 631 | QTimer::singleShot(1000, this, &Image::startSlideshow); | ||
629 | } else { | 632 | } else { | ||
630 | m_currentSlide = -1; | 633 | m_currentSlide = -1; | ||
▲ Show 20 Lines • Show All 260 Lines • ▼ Show 20 Line(s) | 893 | for (const QString &wallpaperCandidate : m_model->wallpapersAwaitingDeletion()) { | |||
891 | removeWallpaper(wallpaperCandidate); | 894 | removeWallpaper(wallpaperCandidate); | ||
892 | } | 895 | } | ||
893 | } | 896 | } | ||
894 | 897 | | |||
895 | void Image::openFolder(const QString& path) | 898 | void Image::openFolder(const QString& path) | ||
896 | { | 899 | { | ||
897 | new KRun(QUrl::fromLocalFile(path), nullptr); | 900 | new KRun(QUrl::fromLocalFile(path), nullptr); | ||
898 | } | 901 | } | ||
902 | | ||||
903 | void Image::toggleSlide(const QString& path, bool checked) | ||||
904 | { | ||||
905 | if (checked && m_uncheckedSlides.contains(path)) { | ||||
906 | m_uncheckedSlides.removeAll(path); | ||||
907 | emit uncheckedSlidesChanged(); | ||||
908 | startSlideshow(); | ||||
909 | } else if (!checked && ! m_uncheckedSlides.contains(path)) { | ||||
910 | m_uncheckedSlides.append(path); | ||||
911 | emit uncheckedSlidesChanged(); | ||||
912 | startSlideshow(); | ||||
913 | } | ||||
914 | } | ||||
915 | | ||||
916 | QStringList Image::uncheckedSlides() const | ||||
917 | { | ||||
918 | return m_uncheckedSlides; | ||||
919 | } | ||||
920 | | ||||
921 | void Image::setUncheckedSlides(const QStringList &uncheckedSlides) | ||||
922 | { | ||||
923 | if (uncheckedSlides == m_uncheckedSlides) { | ||||
924 | return; | ||||
925 | } | ||||
926 | m_uncheckedSlides = uncheckedSlides; | ||||
927 | emit uncheckedSlidesChanged(); | ||||
928 | startSlideshow(); | ||||
929 | } |