diff options
author | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-17 17:36:23 +0000 |
---|---|---|
committer | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-17 17:36:23 +0000 |
commit | a477a1998c03bc0e7251463aff5486e3c0872d23 (patch) | |
tree | 1de3c2d32f1f1811a7dcc2058bfaf26c18f7e296 /movieitem.cpp | |
parent | 1b1e48aa11c4518e100004dac594540e6024fa68 (diff) | |
download | SheMov-a477a1998c03bc0e7251463aff5486e3c0872d23.tar.gz SheMov-a477a1998c03bc0e7251463aff5486e3c0872d23.tar.bz2 SheMov-a477a1998c03bc0e7251463aff5486e3c0872d23.zip |
Huge changes:
-Created an application icon and one for archives
-implemented database configuration dialog
-implemented listeditor
-implemented covereditor
-implemented md5sum helper
-implemented archivefilewidget
-Debugging spree: fixed SQL-statements and ListModel
git-svn-id: file:///var/svn/repos2/shemov/trunk@389 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'movieitem.cpp')
-rw-r--r-- | movieitem.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/movieitem.cpp b/movieitem.cpp index b2fa545..9fb11e1 100644 --- a/movieitem.cpp +++ b/movieitem.cpp @@ -53,7 +53,8 @@ const QVariant MovieItem::dataAt(int column) const { } void MovieItem::populate(){ - QSqlQuery movieData("SELECT ttitle, tfilename, cmd5sum, bisize, igenreid, iquality, idvd FROM movies WHERE imovid = :id"); + QSqlQuery movieData; + movieData.prepare("SELECT ttitle, tfilename, cmd5sum, bisize, igenreid, iquality, idvd FROM movies WHERE imovid = :id"); movieData.bindValue(":id", mId); movieData.exec(); for(int i = 0; i < mNumRows; ++i){ @@ -65,7 +66,8 @@ void MovieItem::populate(){ void MovieItem::setGenreName(){ qint32 genreId = dataAt(Genre).toInt(); - QSqlQuery genreQuery("SELECT tgenrename FROM genre WHERE igenreid = :id"); + QSqlQuery genreQuery; + genreQuery.prepare("SELECT tgenrename FROM genre WHERE igenreid = :id"); genreQuery.bindValue(":id", genreId); genreQuery.exec(); while(genreQuery.next()){ @@ -74,7 +76,8 @@ void MovieItem::setGenreName(){ } void MovieItem::setActors(){ - QSqlQuery actorQuery("SELECT actor.tactorname FROM actors, actormoviemap WHERE actormoviemap.iactorid = actor.iactorid AND actormoviemap.imovid = :id"); + QSqlQuery actorQuery; + actorQuery.prepare("SELECT actor.tactorname FROM actor, movieactormap WHERE movieactormap.iactorid = actor.iactorid AND movieactormap.imovid = :id"); actorQuery.bindValue(":id", mId); actorQuery.exec(); while(actorQuery.next()){ |