Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/image.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | class KDirWatch; | 43 | class KDirWatch; | ||
44 | class KJob; | 44 | class KJob; | ||
45 | 45 | | |||
46 | namespace KNS3 { | 46 | namespace KNS3 { | ||
47 | class DownloadDialog; | 47 | class DownloadDialog; | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | class BackgroundListModel; | 50 | class BackgroundListModel; | ||
51 | class SlideModel; | ||||
51 | 52 | | |||
52 | class Image : public QObject, public QQmlParserStatus | 53 | class Image : public QObject, public QQmlParserStatus | ||
53 | { | 54 | { | ||
54 | Q_OBJECT | 55 | Q_OBJECT | ||
55 | Q_INTERFACES(QQmlParserStatus) | 56 | Q_INTERFACES(QQmlParserStatus) | ||
56 | 57 | | |||
57 | Q_PROPERTY(RenderingMode renderingMode READ renderingMode WRITE setRenderingMode NOTIFY renderingModeChanged) | 58 | Q_PROPERTY(RenderingMode renderingMode READ renderingMode WRITE setRenderingMode NOTIFY renderingModeChanged) | ||
58 | Q_PROPERTY(QUrl wallpaperPath READ wallpaperPath NOTIFY wallpaperPathChanged) | 59 | Q_PROPERTY(QUrl wallpaperPath READ wallpaperPath NOTIFY wallpaperPathChanged) | ||
59 | Q_PROPERTY(QAbstractItemModel *wallpaperModel READ wallpaperModel CONSTANT) | 60 | Q_PROPERTY(QAbstractItemModel *wallpaperModel READ wallpaperModel CONSTANT) | ||
61 | Q_PROPERTY(QAbstractItemModel *slideshowModel READ slideshowModel CONSTANT) | ||||
60 | Q_PROPERTY(int slideTimer READ slideTimer WRITE setSlideTimer NOTIFY slideTimerChanged) | 62 | Q_PROPERTY(int slideTimer READ slideTimer WRITE setSlideTimer NOTIFY slideTimerChanged) | ||
61 | Q_PROPERTY(QStringList usersWallpapers READ usersWallpapers WRITE setUsersWallpapers NOTIFY usersWallpapersChanged) | 63 | Q_PROPERTY(QStringList usersWallpapers READ usersWallpapers WRITE setUsersWallpapers NOTIFY usersWallpapersChanged) | ||
62 | Q_PROPERTY(QStringList slidePaths READ slidePaths WRITE setSlidePaths NOTIFY slidePathsChanged) | 64 | Q_PROPERTY(QStringList slidePaths READ slidePaths WRITE setSlidePaths NOTIFY slidePathsChanged) | ||
63 | Q_PROPERTY(QSize targetSize READ targetSize WRITE setTargetSize NOTIFY targetSizeChanged) | 65 | Q_PROPERTY(QSize targetSize READ targetSize WRITE setTargetSize NOTIFY targetSizeChanged) | ||
64 | Q_PROPERTY(QString photosPath READ photosPath CONSTANT) | 66 | Q_PROPERTY(QString photosPath READ photosPath CONSTANT) | ||
65 | 67 | | |||
66 | public: | 68 | public: | ||
67 | 69 | | |||
Show All 9 Lines | |||||
77 | QUrl wallpaperPath() const; | 79 | QUrl wallpaperPath() const; | ||
78 | 80 | | |||
79 | //this is for QML use | 81 | //this is for QML use | ||
80 | Q_INVOKABLE void addUrl(const QString &url); | 82 | Q_INVOKABLE void addUrl(const QString &url); | ||
81 | Q_INVOKABLE void addUrls(const QStringList &urls); | 83 | Q_INVOKABLE void addUrls(const QStringList &urls); | ||
82 | 84 | | |||
83 | Q_INVOKABLE void addSlidePath(const QString &path); | 85 | Q_INVOKABLE void addSlidePath(const QString &path); | ||
84 | Q_INVOKABLE void removeSlidePath(const QString &path); | 86 | Q_INVOKABLE void removeSlidePath(const QString &path); | ||
87 | Q_INVOKABLE void openFolder(const QString& path); | ||||
85 | 88 | | |||
86 | Q_INVOKABLE void getNewWallpaper(QQuickItem *ctx = nullptr); | 89 | Q_INVOKABLE void getNewWallpaper(QQuickItem *ctx = nullptr); | ||
87 | Q_INVOKABLE void showFileDialog(); | 90 | Q_INVOKABLE void showFileDialog(); | ||
88 | 91 | | |||
89 | Q_INVOKABLE void addUsersWallpaper(const QString &file); | 92 | Q_INVOKABLE void addUsersWallpaper(const QString &file); | ||
90 | Q_INVOKABLE void commitDeletion(); | 93 | Q_INVOKABLE void commitDeletion(); | ||
91 | 94 | | |||
92 | RenderingMode renderingMode() const; | 95 | RenderingMode renderingMode() const; | ||
93 | void setRenderingMode(RenderingMode mode); | 96 | void setRenderingMode(RenderingMode mode); | ||
94 | 97 | | |||
95 | QSize targetSize() const; | 98 | QSize targetSize() const; | ||
96 | void setTargetSize(const QSize &size); | 99 | void setTargetSize(const QSize &size); | ||
97 | 100 | | |||
98 | KPackage::Package *package(); | 101 | KPackage::Package *package(); | ||
99 | 102 | | |||
100 | QAbstractItemModel* wallpaperModel(); | 103 | QAbstractItemModel* wallpaperModel(); | ||
104 | QAbstractItemModel* slideshowModel(); | ||||
101 | 105 | | |||
102 | int slideTimer() const; | 106 | int slideTimer() const; | ||
103 | void setSlideTimer(int time); | 107 | void setSlideTimer(int time); | ||
104 | 108 | | |||
105 | QStringList usersWallpapers() const; | 109 | QStringList usersWallpapers() const; | ||
106 | void setUsersWallpapers(const QStringList &usersWallpapers); | 110 | void setUsersWallpapers(const QStringList &usersWallpapers); | ||
107 | 111 | | |||
108 | QStringList slidePaths() const; | 112 | QStringList slidePaths() const; | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 165 | private: | |||
172 | 176 | | |||
173 | RenderingMode m_mode; | 177 | RenderingMode m_mode; | ||
174 | KPackage::Package m_wallpaperPackage; | 178 | KPackage::Package m_wallpaperPackage; | ||
175 | QStringList m_slideshowBackgrounds; | 179 | QStringList m_slideshowBackgrounds; | ||
176 | QStringList m_unseenSlideshowBackgrounds; | 180 | QStringList m_unseenSlideshowBackgrounds; | ||
177 | QStringList m_slidePaths; | 181 | QStringList m_slidePaths; | ||
178 | QTimer m_timer; | 182 | QTimer m_timer; | ||
179 | int m_currentSlide; | 183 | int m_currentSlide; | ||
180 | BackgroundListModel *m_model; | 184 | BackgroundListModel *m_model; | ||
185 | SlideModel* m_slideshowModel; | ||||
181 | QFileDialog *m_dialog; | 186 | QFileDialog *m_dialog; | ||
davidedmundson: Why do we need two instances? | |||||
Can you elaborate on that please? Are you saying I should assign my Model to m_model and then cast it to call the added method? Or something different like overriding an existing method or adding the functions BackgroundListModel? davidre: Can you elaborate on that please? Are you saying I should assign my Model to m_model and then… | |||||
182 | QString m_img; | 187 | QString m_img; | ||
183 | QDateTime m_previousModified; | 188 | QDateTime m_previousModified; | ||
184 | QPointer<KNS3::DownloadDialog> m_newStuffDialog; | 189 | QPointer<KNS3::DownloadDialog> m_newStuffDialog; | ||
185 | QString m_findToken; | 190 | QString m_findToken; | ||
186 | }; | 191 | }; | ||
187 | 192 | | |||
188 | #endif | 193 | #endif |
Why do we need two instances?