diff options
author | Arno <am@disconnect.de> | 2010-07-29 22:26:54 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-07-29 22:26:54 +0200 |
commit | a493d6500c33a0956e0165ad53136fa6110a7a64 (patch) | |
tree | 866d3d8dfb9fd461b90b166270aa8a7ce9385589 /mappingtablemodel.cpp | |
parent | 82789cd9e72688b72add622f27598e9aad879af0 (diff) | |
download | SheMov-a493d6500c33a0956e0165ad53136fa6110a7a64.tar.gz SheMov-a493d6500c33a0956e0165ad53136fa6110a7a64.tar.bz2 SheMov-a493d6500c33a0956e0165ad53136fa6110a7a64.zip |
Fix SQL errors
While trying to find out why a newly added SeriesPart won't get selected
programmatically, I discovered a not so serious SQL bug.
MappingTableModel::addMapping happily tries to execute queries with an
invalid seriesPartId. Return if seriesPartId = -1.
Now all items expanded previously will be expanded after adding a new
movie. (SeriesTreeWidgetT::seriesAdded). Unfortunately the original
problem remains unsolved...
Diffstat (limited to 'mappingtablemodel.cpp')
-rw-r--r-- | mappingtablemodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mappingtablemodel.cpp b/mappingtablemodel.cpp index bcb601e..65221e4 100644 --- a/mappingtablemodel.cpp +++ b/mappingtablemodel.cpp @@ -163,6 +163,9 @@ bool MappingTableModel::removeItem(const QModelIndex &idx){ } bool MappingTableModel::addMapping(int seriesPartId, int itemId){ + if(seriesPartId == -1){ + return false; + } mDb.transaction(); mAddMappingQuery->bindValue(":id1", seriesPartId); mAddMappingQuery->bindValue(":id2", itemId); |