summaryrefslogtreecommitdiffstats
path: root/smmodelsingleton.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-06-26 15:24:00 +0200
committerArno <am@disconnect.de>2010-06-26 15:24:00 +0200
commit0b807eba97e65bf9e25f83387826ef2579b79c90 (patch)
tree9a86166a4ebd77d95e9a26b723c49ebab417e337 /smmodelsingleton.cpp
parent6567a92bec5ca8b2bc6b7156bddc5ba8508f31b3 (diff)
downloadSheMov-0b807eba97e65bf9e25f83387826ef2579b79c90.tar.gz
SheMov-0b807eba97e65bf9e25f83387826ef2579b79c90.tar.bz2
SheMov-0b807eba97e65bf9e25f83387826ef2579b79c90.zip
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.
Diffstat (limited to 'smmodelsingleton.cpp')
-rw-r--r--smmodelsingleton.cpp4
1 files changed, 2 insertions, 2 deletions
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");