| 1 |
/* |
| 2 |
* Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd. |
| 3 |
* |
| 4 |
* Author: ZhangYong <[email protected]> |
| 5 |
* |
| 6 |
* Maintainer: ZhangYong <[email protected]> |
| 7 |
* |
| 8 |
* This program is free software: you can redistribute it and/or modify |
| 9 |
* it under the terms of the GNU General Public License as published by |
| 10 |
* the Free Software Foundation, either version 3 of the License, or |
| 11 |
* any later version. |
| 12 |
* |
| 13 |
* This program is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
* GNU General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU General Public License |
| 19 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 |
*/ |
| 21 |
#ifndef DBandImgOperate_H |
| 22 |
#define DBandImgOperate_H |
| 23 |
|
| 24 |
// ImageTable |
| 25 |
/////////////////////////////////////////////////////// |
| 26 |
//FilePath | FileName | Dir | Time | ChangeTime | ImportTime // |
| 27 |
//TEXT primari key | TEXT | TEXT | TEXT | TEXT | TEXT // |
| 28 |
/////////////////////////////////////////////////////// |
| 29 |
|
| 30 |
// AlbumTable |
| 31 |
///////////////////////////////////////////////////// |
| 32 |
//AP | AlbumName | FilePath // |
| 33 |
//TEXT primari key | TEXT | TEXT // |
| 34 |
///////////////////////////////////////////////////// |
| 35 |
|
| 36 |
#include <QObject> |
| 37 |
#include <QDateTime> |
| 38 |
#include <QMutex> |
| 39 |
#include <QDebug> |
| 40 |
#include <QSqlDatabase> |
| 41 |
#include "dbmanager.h" |
| 42 |
#include "imageengineobject.h" |
| 43 |
class QSqlDatabase; |
| 44 |
|
| 45 |
class DBandImgOperate : public QObject |
| 46 |
{ |
| 47 |
Q_OBJECT |
| 48 |
public: |
| 49 |
explicit DBandImgOperate(QObject *parent = nullptr); |
| 50 |
~DBandImgOperate(); |
| 51 |
public slots: |
| 52 |
void setThreadShouldStop(); |
| 53 |
//获取全部相片信息 |
| 54 |
// void getAllInfos(); |
| 55 |
//产生缩略图 |
| 56 |
//加载一张缩略图 |
| 57 |
// QPixmap loadOneThumbnail(const QString &imagepath); |
| 58 |
//制作一张缩略图,并通过信号传至主线程 |
| 59 |
// void loadOneImg(QString imagepath); |
| 60 |
void loadOneImgForce(QString imagepath, bool refresh);//缩略图已存在仍然强制刷新缩略图 |
| 61 |
//旋转图片并重新制作缩略图 |
| 62 |
void rotateImageFile(int angel, const QString &path); |
| 63 |
void sltLoadThumbnailByNum(QVector<DBImgInfo> infos, int num); |
| 64 |
//加载设备中图片列表请求完成 |
| 65 |
void sltLoadMountFileList(const QString &path); |
| 66 |
signals: |
| 67 |
void sig80ImgInfosReady(QVector<DBImgInfo> imageDatas); |
| 68 |
void sigOneImgReady(QString imagepath, QPixmap pimap); |
| 69 |
|
| 70 |
void sigAllImgInfosReady(DBImgInfoList); |
| 71 |
void loadOneThumbnailReady(QString imagepath, DBImgInfo data); |
| 72 |
void fileIsNotExist(QString imagepath); |
| 73 |
//加载设备中图片列表请求完成 |
| 74 |
void sigMountFileListLoadReady(QString path, QStringList fileList); |
| 75 |
public: |
| 76 |
int m_loadBegin = 0; |
| 77 |
int m_loadEnd = 0; |
| 78 |
private: |
| 79 |
QStringList m_ImgPaths; |
| 80 |
std::atomic<bool> m_couldRun; |
| 81 |
QVector<QPixmap> m_pixmaps; |
| 82 |
QMap<QString, QStringList>m_PhonePicFileMap; //外部设备及其全部图片路径 |
| 83 |
}; |
| 84 |
|
| 85 |
#endif // DBOPERATE_H |