diff options
Diffstat (limited to 'smmodelsingleton.cpp')
-rw-r--r-- | smmodelsingleton.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/smmodelsingleton.cpp b/smmodelsingleton.cpp index 08cbbba..2ee5623 100644 --- a/smmodelsingleton.cpp +++ b/smmodelsingleton.cpp @@ -12,6 +12,7 @@ #include "smmodelsingleton.h" #include "seriestreemodel.h" #include "filestreemodel.h" +#include "mappingtablemodel.h" SmModelSingleton *SmModelSingleton::mInstance = 0; @@ -50,6 +51,18 @@ QAbstractItemModel *SmModelSingleton::model(const QString &which){ FilesTreeModel *model = new FilesTreeModel(headers); mModels.insert(which, model); } + }else if(which == "ActorsModel"){ + if(!mModels.contains(which)){ + QStringList headers = QStringList() << tr("Actor") << tr("Id"); + MappingTableModel *model = new MappingTableModel(headers, "actors"); + mModels.insert(which, model); + } + }else if(which == "GenresModel"){ + if(!mModels.contains(which)){ + QStringList headers = QStringList() << tr("Genre") << tr("Id"); + MappingTableModel *model = new MappingTableModel(headers, "genres"); + mModels.insert(which, model); + } } - return mModels.contains(which) ? mModels.value(which ) : 0; + return mModels.contains(which) ? mModels.value(which) : 0; } |