presentation/ComposeThumbnailProvider.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <QQuickImageProvider> | ||
| 4 | |||
| 5 | // "image://compose-thumbnails/<percent-encoded path>" (Sprint 108 S108.6.1): | ||
| 6 | // the attachment tray's thumbnail of an image copied into a draft store. | ||
| 7 | // Only files below a "compose-drafts" directory are read (the draft store | ||
| 8 | // of ComposeDraftFiles); anything else yields an empty image. The decode is | ||
| 9 | // bounded (QImageReader scaled to at most 256 px, EXIF orientation applied) | ||
| 10 | // and runs on the engine's image thread (Image.asynchronous). | ||
| 11 | class ComposeThumbnailProvider final : public QQuickImageProvider { | ||
| 12 | public: | ||
| 13 |
1/1✓ Branch 3 → 4 taken 766 times.
|
766 | ComposeThumbnailProvider() : QQuickImageProvider(QQuickImageProvider::Image) {} |
| 14 | QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override; | ||
| 15 | // The path a thumbnail id names, or "" when it is outside a draft store. | ||
| 16 | static QString draftPath(const QString &id); | ||
| 17 | }; | ||
| 18 |