blame: src/thumbnailworker.h
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 1 | #pragma once |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 2 | |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 3 | #include <QRunnable> |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 4 | #include <QObject> |
| 6fcd6c90 | Poul Sander | 2026-02-19 21:12 | 5 | #include <QImage> |
| 6fcd6c90 | Poul Sander | 2026-02-19 21:12 | 6 | #include <atomic> |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 7 | |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 8 | class ThumbnailWorker : public QObject, public QRunnable |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 9 | { |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 10 | Q_OBJECT |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 11 | |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 12 | public: |
| 6fcd6c90 | Poul Sander | 2026-02-19 21:12 | 13 | ThumbnailWorker(const QString &path, |
| 6fcd6c90 | Poul Sander | 2026-02-19 21:12 | 14 | int row, |
| 6fcd6c90 | Poul Sander | 2026-02-19 21:12 | 15 | std::atomic_bool *cancelFlag); |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 16 | |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 17 | void run() override; |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 18 | |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 19 | signals: |
| 6fcd6c90 | Poul Sander | 2026-02-19 21:12 | 20 | void finished(int row, const QImage &image); |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 21 | |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 22 | private: |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 23 | QString m_path; |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 24 | int m_row; |
| 6fcd6c90 | Poul Sander | 2026-02-19 21:12 | 25 | std::atomic_bool *m_cancelFlag; |
| cec3b5da | Poul Sander | 2026-02-19 19:17 | 26 | }; |
| 1970-01-01 00:00 | 27 |