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. --- smglobals.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'smglobals.cpp') diff --git a/smglobals.cpp b/smglobals.cpp index 93ec72e..c435a2c 100644 --- a/smglobals.cpp +++ b/smglobals.cpp @@ -28,6 +28,7 @@ #include "seriesmetadatamodel.h" #include "mappingtreemodel.h" #include "pictureviewer2.h" +#include "picfilesmodel.h" #include "configurationdialog.h" SmGlobals *SmGlobals::mInstance = 0; @@ -98,6 +99,12 @@ QAbstractItemModel *SmGlobals::model(const QString &which){ MappingTreeModel *model = new MappingTreeModel(headers); mModels.insert(which, model); } + }else if(which == "PicFiles"){ + if(!mModels.contains("PicFiles")){ + QStringList headers = QStringList() << tr("Filename") << tr("SizeNum") << tr("Format") << tr("Full Path") << tr("Id") << tr("Added") << tr("Md5Sum") << tr("Size"); + PicFilesModel *model = new PicFilesModel(headers); + mModels.insert(which, model); + } } return mModels.contains(which) ? mModels.value(which) : 0; } -- cgit v1.2.3-70-g09d2