Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/backgroundlistmodel.cpp
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Line(s) | 116 | { | |||
---|---|---|---|---|---|
132 | 132 | | |||
133 | const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("wallpapers/"), QStandardPaths::LocateDirectory); | 133 | const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("wallpapers/"), QStandardPaths::LocateDirectory); | ||
134 | qCDebug(IMAGEWALLPAPER) << "Looking into" << dirs << "for wallpapers"; | 134 | qCDebug(IMAGEWALLPAPER) << "Looking into" << dirs << "for wallpapers"; | ||
135 | 135 | | |||
136 | BackgroundFinder *finder = new BackgroundFinder(m_wallpaper.data(), dirs); | 136 | BackgroundFinder *finder = new BackgroundFinder(m_wallpaper.data(), dirs); | ||
137 | connect(finder, &BackgroundFinder::backgroundsFound, this, &BackgroundListModel::backgroundsFound); | 137 | connect(finder, &BackgroundFinder::backgroundsFound, this, &BackgroundListModel::backgroundsFound); | ||
138 | m_findToken = finder->token(); | 138 | m_findToken = finder->token(); | ||
139 | finder->start(); | 139 | finder->start(); | ||
140 | | ||||
141 | #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) | ||||
140 | m_removableWallpapers = QSet<QString>::fromList(selected); | 142 | m_removableWallpapers = QSet<QString>::fromList(selected); | ||
143 | #else | ||||
144 | m_removableWallpapers = QSet<QString>(selected.begin(), selected.end()); | ||||
145 | #endif | ||||
141 | } | 146 | } | ||
142 | 147 | | |||
143 | void BackgroundListModel::backgroundsFound(const QStringList &paths, const QString &token) | 148 | void BackgroundListModel::backgroundsFound(const QStringList &paths, const QString &token) | ||
144 | { | 149 | { | ||
145 | if (token == m_findToken) { | 150 | if (token == m_findToken) { | ||
146 | processPaths(paths); | 151 | processPaths(paths); | ||
147 | } | 152 | } | ||
148 | } | 153 | } | ||
▲ Show 20 Lines • Show All 443 Lines • Show Last 20 Lines |