summaryrefslogtreecommitdiffstats
path: root/moviemodel.cpp
diff options
context:
space:
mode:
authoram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-07-22 18:44:02 +0000
committeram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-07-22 18:44:02 +0000
commit0e3e202c90e3ccb80310087409936c00189f0cea (patch)
treea4a38c32e761f024e2dfad6a59097cff15472b9e /moviemodel.cpp
parent84ed109c159dcbd0c9395717d54599e902060b26 (diff)
downloadSheMov-0e3e202c90e3ccb80310087409936c00189f0cea.tar.gz
SheMov-0e3e202c90e3ccb80310087409936c00189f0cea.tar.bz2
SheMov-0e3e202c90e3ccb80310087409936c00189f0cea.zip
-Finished CoverArchiveEditor (finally, don't like that piece of code, too complicated)
-It's now possible to manually add a movie w/o a file -Some usability fixes git-svn-id: file:///var/svn/repos2/shemov/trunk@394 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'moviemodel.cpp')
-rw-r--r--moviemodel.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/moviemodel.cpp b/moviemodel.cpp
index 8bfa846..7fbac31 100644
--- a/moviemodel.cpp
+++ b/moviemodel.cpp
@@ -81,6 +81,18 @@ QModelIndex MovieModel::index(int movieId, int column) const{
return retval;
}
+QModelIndex MovieModel::index(const QString &movieTitle) const {
+ QModelIndex retval = QModelIndex();
+ for(int i = 0; i < rowCount(QModelIndex()); ++i){
+ MovieItem *item = mItems.at(i);
+ if(item->dataAt(MovieItem::Title).toString() == movieTitle){
+ retval = createIndex(i, 0, item);
+ break;
+ }
+ }
+ return retval;
+}
+
QVariant MovieModel::data(const QModelIndex &index, int role) const{
if(!index.isValid()){
return QVariant();