| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_RECENTIMAGESPATHSTORE_H |
| 21 |
#define KSNIP_RECENTIMAGESPATHSTORE_H |
| 22 |
|
| 23 |
#include <QQueue> |
| 24 |
#include <QSharedPointer> |
| 25 |
|
| 26 |
#include <algorithm> |
| 27 |
|
| 28 |
#include "IImagePathStorage.h" |
| 29 |
#include "IRecentImageService.h" |
| 30 |
|
| 31 |
class RecentImagesPathStore : public IRecentImageService |
| 32 |
{ |
| 33 |
public: |
| 34 |
explicit RecentImagesPathStore(const QSharedPointer<IImagePathStorage> &imagePathStorage); |
| 35 |
~RecentImagesPathStore() override = default; |
| 36 |
|
| 37 |
void storeImagePath(const QString &imagePath) override; |
| 38 |
QStringList getRecentImagesPath() const override; |
| 39 |
|
| 40 |
private: |
| 41 |
const QSharedPointer<IImagePathStorage> mImagePathStorage; |
| 42 |
QQueue<QString> mRecentImagesPathCache; |
| 43 |
const int mMaxRecentItems; |
| 44 |
|
| 45 |
void loadRecentImagesPath(); |
| 46 |
void saveRecentImagesPath(); |
| 47 |
}; |
| 48 |
|
| 49 |
#endif |