diff options
author | Arno <am@disconnect.de> | 2013-08-22 07:43:20 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-08-22 07:43:20 +0200 |
commit | 369c14264c664b38049ac081cf60b8485a4042cb (patch) | |
tree | 5e77075e82d5d0caf7f0a7743a9a69f42ac9df9e /picfilesmodel.h | |
parent | cd2d39368e2319eb7c949439e9688bf8319ec0a3 (diff) | |
download | SheMov-369c14264c664b38049ac081cf60b8485a4042cb.tar.gz SheMov-369c14264c664b38049ac081cf60b8485a4042cb.tar.bz2 SheMov-369c14264c664b38049ac081cf60b8485a4042cb.zip |
Give Pictures some love!
* Show and archive size of pictures
* Fix SqlQueries in PicFilesModel: removeFiles and changeMappings
* use delegate in PictureView
Diffstat (limited to 'picfilesmodel.h')
-rw-r--r-- | picfilesmodel.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/picfilesmodel.h b/picfilesmodel.h index 6a033c1..a538f75 100644 --- a/picfilesmodel.h +++ b/picfilesmodel.h @@ -14,8 +14,8 @@ class PicFilesModel : public SmTreeModel { Q_OBJECT public: - enum Roles { FileNameRole = Qt::UserRole + 1, SizeRole = Qt::UserRole + 2, MimeTypeRole = Qt::UserRole + 3, FullPathRole = Qt::UserRole + 4, IdRole = Qt::UserRole + 5, AddedRole = Qt::UserRole + 6, Md5SumRole = Qt::UserRole + 7, SizeDisplayRole = Qt::UserRole + 8 }; - enum Fields { FileName = 0, Size = 1, MimeType = 2, FullPath = 3, Id = 4, Added = 5, Md5Sum = 6, SizeDisplay = 7 }; + enum Roles { FileNameRole = Qt::UserRole + 1, SizeRole = Qt::UserRole + 2, MimeTypeRole = Qt::UserRole + 3, FullPathRole = Qt::UserRole + 4, IdRole = Qt::UserRole + 5, AddedRole = Qt::UserRole + 6, Md5SumRole = Qt::UserRole + 7, PicSizeRole = Qt::UserRole + 8 }; + enum Fields { FileName = 0, Size = 1, MimeType = 2, FullPath = 3, Id = 4, Added = 5, Md5Sum = 6, PicSize = 7 }; enum { NumFields = 8 }; explicit PicFilesModel(const QStringList &headers, QObject *parent = 0); void setMapping(int pMapId); @@ -25,7 +25,7 @@ class PicFilesModel : public SmTreeModel { QVariant data(const QModelIndex &index, int role) const; QList<QVariant> dataList(const QModelIndex &idx) const; QList<QList<QVariant> > allFiles() const; - void removeFiles(const QList<QPersistentModelIndex> &files); + void removeFiles(const QList<QPair<int, QString> > &files); bool changeMappings(const QList<int> &fileIds, const QList<QVariant> &parentIds); QList<MappingData> mappingDataFromFile(int fileId) const; QList<MappingData> mappingDataFromFiles(const QList<int> fileIds) const; @@ -39,9 +39,6 @@ class PicFilesModel : public SmTreeModel { MappingTreeModel *mMappingTreeModel; QString mPopulateQS; QString mMappingsQS; - QSqlQuery *mDeleteFileQ; - QSqlQuery *mDeleteMappingsQ; - QSqlQuery *mAddMappingsQ; QList<int> mMappingIds; }; |