Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/slidemodel.cpp
Show All 32 Lines | |||||
33 | { | 33 | { | ||
34 | BackgroundFinder *finder = new BackgroundFinder(m_wallpaper.data(), QStringList{path}); | 34 | BackgroundFinder *finder = new BackgroundFinder(m_wallpaper.data(), QStringList{path}); | ||
35 | connect(finder, &BackgroundFinder::backgroundsFound, this, &SlideModel::removeBackgrounds); | 35 | connect(finder, &BackgroundFinder::backgroundsFound, this, &SlideModel::removeBackgrounds); | ||
36 | finder->start(); | 36 | finder->start(); | ||
37 | } | 37 | } | ||
38 | 38 | | |||
39 | void SlideModel::removeBackgrounds(const QStringList &paths, const QString &token) | 39 | void SlideModel::removeBackgrounds(const QStringList &paths, const QString &token) | ||
40 | { | 40 | { | ||
41 | Q_FOREACH (const QString &file, paths) { | 41 | for (const QString &file : paths) { | ||
42 | removeBackground(file); | 42 | removeBackground(file); | ||
43 | } | 43 | } | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | QVariant SlideModel::data(const QModelIndex& index, int role) const | 46 | QVariant SlideModel::data(const QModelIndex& index, int role) const | ||
47 | { | 47 | { | ||
48 | if (role == ToggleRole) { | 48 | if (role == ToggleRole) { | ||
49 | return !m_wallpaper.data()->uncheckedSlides().contains(data(index, PathRole).toString()); | 49 | return !m_wallpaper.data()->uncheckedSlides().contains(data(index, PathRole).toString()); | ||
Show All 10 Lines |