From 0b807eba97e65bf9e25f83387826ef2579b79c90 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 26 Jun 2010 15:24:00 +0200 Subject: Actors and genre edit Implemented widgets for actor and genre editing of movies. Created new MappingTableWidget for both genres and actors and revamped ArchiveTreeView to show 2 widgets below the FilesTreeView separated by a splitter. While testing the new setup several bugs were fixed: -an SQL syntax error in FilesTreeModel -fixed SmModelSingleton to properly work with table names I also changed the signature of MappingTableModel::addMapping for the ease of use and added MappingTableModel::removeMapping. MappingTableModel got 2 new convenience functions: 1. bool contains(QString) to check if an item is already present 2. QModelIndex find() to get the index of a specific value from the model. --- smmodelsingleton.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'smmodelsingleton.cpp') diff --git a/smmodelsingleton.cpp b/smmodelsingleton.cpp index 2ee5623..7425aeb 100644 --- a/smmodelsingleton.cpp +++ b/smmodelsingleton.cpp @@ -51,13 +51,13 @@ QAbstractItemModel *SmModelSingleton::model(const QString &which){ FilesTreeModel *model = new FilesTreeModel(headers); mModels.insert(which, model); } - }else if(which == "ActorsModel"){ + }else if(which == "actors"){ 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"){ + }else if(which == "genres"){ if(!mModels.contains(which)){ QStringList headers = QStringList() << tr("Genre") << tr("Id"); MappingTableModel *model = new MappingTableModel(headers, "genres"); -- cgit v1.2.3-70-g09d2