Changeset View
Changeset View
Standalone View
Standalone View
dataengines/potd/unsplashprovider.h
Show All 22 Lines | |||||
23 | #include "potdprovider.h" | 23 | #include "potdprovider.h" | ||
24 | // Qt | 24 | // Qt | ||
25 | #include <QImage> | 25 | #include <QImage> | ||
26 | 26 | | |||
27 | class KJob; | 27 | class KJob; | ||
28 | 28 | | |||
29 | /** | 29 | /** | ||
30 | * This class provides random wallpapers from Unsplash Wallpapers | 30 | * This class provides random wallpapers from Unsplash Wallpapers | ||
31 | * Image urls are parsed from https://unsplash.com/wallpaper/1065396/desktop-wallpapers | 31 | * https://unsplash.com/wallpaper/ | ||
32 | */ | 32 | */ | ||
33 | class UnsplashProvider : public PotdProvider | 33 | class UnsplashProvider : public PotdProvider | ||
34 | { | 34 | { | ||
35 | Q_OBJECT | 35 | Q_OBJECT | ||
36 | 36 | | |||
37 | public: | 37 | public: | ||
38 | /** | 38 | /** | ||
39 | * Creates a new Unsplash provider. | 39 | * Creates a new Unsplash provider. | ||
Show All 12 Lines | |||||
52 | * Returns the requested image. | 52 | * Returns the requested image. | ||
53 | * | 53 | * | ||
54 | * Note: This method returns only a valid image after the | 54 | * Note: This method returns only a valid image after the | ||
55 | * finished() signal has been emitted. | 55 | * finished() signal has been emitted. | ||
56 | */ | 56 | */ | ||
57 | QImage image() const override; | 57 | QImage image() const override; | ||
58 | 58 | | |||
59 | private: | 59 | private: | ||
60 | void pageRequestFinished(KJob *job); | | |||
61 | void imageRequestFinished(KJob *job); | 60 | void imageRequestFinished(KJob *job); | ||
62 | 61 | | |||
63 | private: | 62 | private: | ||
64 | QImage mImage; | 63 | QImage mImage; | ||
65 | }; | 64 | }; | ||
66 | 65 | | |||
67 | #endif | 66 | #endif |