From 184448e767ccdeae66fe4d795757cace98033b0e Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 4 Oct 2012 06:59:44 +0200 Subject: Fix Mappings in PictureViewer2 Another fix for the new MappingTreeModel database layout: Make the mappings display correctly when showing an archived picture. For performance reasons I had to make PicFilesModel global and put it into a separate file. Also clean up MappingTreeModel: remove comments and unused functions. --- mappingtreemodel.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'mappingtreemodel.h') diff --git a/mappingtreemodel.h b/mappingtreemodel.h index f2771c9..72a7b7f 100644 --- a/mappingtreemodel.h +++ b/mappingtreemodel.h @@ -50,13 +50,12 @@ class MappingTreeModel : public SmTreeModel { bool deleteChild(const QModelIndex &idx); int childCount(const QModelIndex &idx) const; MappingData mappingDataFromIndex(QModelIndex &idx) const; - MappingData mappingDataFromId(int mappingId) const; QStringList paths() const; const QString &forbidden() const { return mForbidden; } public slots: void populate(); - void setType(int type); // { mType = type; } + void setType(int type); signals: void mappingTypesChanged(); @@ -92,8 +91,6 @@ class MappingTreeModel : public SmTreeModel { QSqlQuery *mMappingsForFileIdQ; QSqlQuery *mMappingsQ; QList mMappingTypes; - QList mValidMappings; - QList mSelectedMappings; QMap mMappings; const QString mForbidden; int mType; @@ -125,7 +122,9 @@ class MappingTreeResultModel : public SmTreeModel { struct MappingData { int id; QString name; - QStringList path; + QList path; }; +Q_DECLARE_METATYPE(QList) + #endif // MAPPINGTREEMODEL_H -- cgit v1.2.3-70-g09d2