From 6b8c2cf35525c62b1e7a0279a7ebaa175848d268 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 17 Mar 2012 11:48:24 +0100 Subject: Make nodes with children selectable in picture widget This was a tough one. Lost in recursion. When selecting nodes with children in the picture widget, all files having this node as mapping parent are shown. Had to make some changes to SmTreeModel::findRecursive for this. I hope I didn't break anything. If I did, I'll fix it :) Also disposed of some comments and unused member variables. --- pictureswidget.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'pictureswidget.h') diff --git a/pictureswidget.h b/pictureswidget.h index 40c1874..41df3b8 100644 --- a/pictureswidget.h +++ b/pictureswidget.h @@ -19,6 +19,7 @@ class PictureView; class MappingTreeWidget; class MappingEditWidget; class MappingEditDialog; +class MappingTreeModel; class QSqlQuery; class PicFilesModel; class QSortFilterProxyModel; @@ -103,7 +104,8 @@ class PicFilesModel : public SmTreeModel { enum Fields { FileName = 0, Size = 1, MimeType = 2, FullPath = 3, Id = 4, Added = 5, Md5Sum = 6, SizeDisplay = 7 }; enum { NumFields = 8 }; explicit PicFilesModel(const QStringList &headers, QObject *parent = 0); - void setMapping(int mappingId) { mMappingId = mappingId; } + ~PicFilesModel(); + void setMapping(int mappingId); QList mappingIds(const QList &fileIds); //some data @@ -119,15 +121,14 @@ class PicFilesModel : public SmTreeModel { private: QSqlDatabase mDb; - QSqlQuery *mPopulateQ; + MappingTreeModel *mMappingTreeModel; + QString mPopulateQS; QSqlQuery *mDeleteFileQ; - QSqlQuery *mCurMappingIdsQ; QSqlQuery *mDeleteMappingsQ; QSqlQuery *mAddMappingsQ; QSqlQuery *mAllFilesQ; QString mCurMappingIdsQS; - int mMappingId; - QList mCurMappingsIds; + QList mMappingIds; }; #endif // PICTURESWIDGET_H -- cgit v1.2.3-70-g09d2