Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/backgroundlistmodel.h
Show All 20 Lines | |||||
21 | #define BACKGROUNDLISTMODEL_H | 21 | #define BACKGROUNDLISTMODEL_H | ||
22 | 22 | | |||
23 | #include "image.h" | 23 | #include "image.h" | ||
24 | 24 | | |||
25 | #include <QAbstractListModel> | 25 | #include <QAbstractListModel> | ||
26 | #include <QPixmap> | 26 | #include <QPixmap> | ||
27 | #include <QRunnable> | 27 | #include <QRunnable> | ||
28 | #include <QThread> | 28 | #include <QThread> | ||
29 | #include <QMutex> | ||||
29 | #include <QSet> | 30 | #include <QSet> | ||
30 | 31 | | |||
31 | #include <KDirWatch> | 32 | #include <KDirWatch> | ||
32 | #include <KFileItem> | 33 | #include <KFileItem> | ||
33 | 34 | | |||
34 | #include <kimagecache.h> | 35 | #include <kimagecache.h> | ||
35 | 36 | | |||
36 | #include <KPackage/PackageStructure> | 37 | #include <KPackage/PackageStructure> | ||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 126 | { | |||
126 | Q_OBJECT | 127 | Q_OBJECT | ||
127 | 128 | | |||
128 | public: | 129 | public: | ||
129 | BackgroundFinder(Image *wallpaper, const QStringList &p); | 130 | BackgroundFinder(Image *wallpaper, const QStringList &p); | ||
130 | ~BackgroundFinder() override; | 131 | ~BackgroundFinder() override; | ||
131 | 132 | | |||
132 | QString token() const; | 133 | QString token() const; | ||
133 | 134 | | |||
134 | static const QStringList &suffixes(); | 135 | static QStringList suffixes(); | ||
135 | static bool isAcceptableSuffix(const QString &suffix); | 136 | static bool isAcceptableSuffix(const QString &suffix); | ||
136 | 137 | | |||
137 | Q_SIGNALS: | 138 | Q_SIGNALS: | ||
138 | void backgroundsFound(const QStringList &paths, const QString &token); | 139 | void backgroundsFound(const QStringList &paths, const QString &token); | ||
139 | 140 | | |||
140 | protected: | 141 | protected: | ||
141 | void run() override; | 142 | void run() override; | ||
142 | 143 | | |||
143 | private: | 144 | private: | ||
144 | QStringList m_paths; | 145 | QStringList m_paths; | ||
145 | QString m_token; | 146 | QString m_token; | ||
146 | 147 | | |||
147 | static QStringList m_suffixes; | 148 | static QMutex s_suffixMutex; | ||
149 | static QStringList s_suffixes; | ||||
148 | }; | 150 | }; | ||
149 | 151 | | |||
150 | #endif // BACKGROUNDLISTMODEL_H | 152 | #endif // BACKGROUNDLISTMODEL_H |