Changeset View
Changeset View
Standalone View
Standalone View
src/project/projectmodel.h
Show All 22 Lines | 1 | /* **************************************************************************** | |||
---|---|---|---|---|---|
23 | You should have received a copy of the GNU General Public License | 23 | You should have received a copy of the GNU General Public License | ||
24 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 24 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | 25 | | |||
26 | **************************************************************************** */ | 26 | **************************************************************************** */ | ||
27 | 27 | | |||
28 | #ifndef PROJECTMODEL_H | 28 | #ifndef PROJECTMODEL_H | ||
29 | #define PROJECTMODEL_H | 29 | #define PROJECTMODEL_H | ||
30 | 30 | | |||
31 | #include <kdirmodel.h> | | |||
32 | #include <kdirlister.h> | | |||
33 | #include <QHash> | 31 | #include <QHash> | ||
34 | #include <QList> | 32 | #include <QList> | ||
35 | #include <QRunnable> | 33 | | ||
34 | #include <KDirModel> | ||||
36 | 35 | | |||
37 | #include "project.h" | 36 | #include "project.h" | ||
38 | #include "projectlocal.h" | 37 | #include "projectlocal.h" | ||
39 | #include "metadata/filemetadata.h" | 38 | #include "metadata/filemetadata.h" | ||
40 | 39 | | |||
41 | class QTimer; | 40 | class QTimer; | ||
42 | class QThreadPool; | 41 | class QThreadPool; | ||
43 | class UpdateStatsJob; | 42 | class UpdateStatsJob; | ||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Line(s) | 204 | private: | |||
248 | QTimer* m_doneTimer; | 247 | QTimer* m_doneTimer; | ||
249 | QTimer* m_delayedReloadTimer; | 248 | QTimer* m_delayedReloadTimer; | ||
250 | 249 | | |||
251 | QThreadPool* m_threadPool; | 250 | QThreadPool* m_threadPool; | ||
252 | 251 | | |||
253 | bool m_completeScan; | 252 | bool m_completeScan; | ||
254 | }; | 253 | }; | ||
255 | 254 | | |||
256 | | ||||
257 | | ||||
258 | class UpdateStatsJob: public QObject, public QRunnable | | |||
259 | { | | |||
260 | Q_OBJECT | | |||
261 | public: | | |||
262 | explicit UpdateStatsJob(const QList<KFileItem> &files, QObject* owner = nullptr); | | |||
263 | ~UpdateStatsJob() override; | | |||
264 | int priority()const | | |||
265 | { | | |||
266 | return 35; //SEE jobs.h | | |||
267 | } | | |||
268 | | ||||
269 | void setStatus(int status); | | |||
270 | | ||||
271 | QList<KFileItem> m_files; | | |||
272 | QList<FileMetaData> m_info; | | |||
273 | volatile int m_status; // 0 = running; -1 = cancel; -2 = abort | | |||
274 | | ||||
275 | protected: | | |||
276 | void run() override; | | |||
277 | | ||||
278 | signals: | | |||
279 | void done(UpdateStatsJob*); | | |||
280 | }; | | |||
281 | | ||||
282 | | ||||
283 | #endif | 255 | #endif |