bug fixing when deleting multiple items
This commit is contained in:
+1
-1
@@ -192,7 +192,7 @@ bool cChapterList::save()
|
||||
querySelect.prepare("SELECT id FROM chapter WHERE _rowid_=(SELECT MAX(_rowid_) FROM chapter);");
|
||||
queryDelete.prepare("DELETE FROM chapter WHERE id=:id;");
|
||||
|
||||
for(int x = 0;x < count();x++)
|
||||
for(int x = count()-1;x >= 0;x--)
|
||||
{
|
||||
cChapter* lpChapter = at(x);
|
||||
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ bool cObjectList::save()
|
||||
imageDelete.prepare("DELETE FROM objectImage WHERE objectID=:objectID;");
|
||||
imageAdd.prepare("INSERT INTO objectImage (objectID, name, description, image) VALUES (:objectID, :name, :description, :image);");
|
||||
|
||||
for(int x = 0;x < count();x++)
|
||||
for(int x = count()-1;x >= 0;x--)
|
||||
{
|
||||
cObject* lpObject = at(x);
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ bool cPartList::save()
|
||||
querySelect.prepare("SELECT id FROM part WHERE _rowid_=(SELECT MAX(_rowid_) FROM part);");
|
||||
queryDelete.prepare("DELETE FROM part WHERE id=:id;");
|
||||
|
||||
for(int x = 0;x < count();x++)
|
||||
for(int x = count()-1;x >= 0;x--)
|
||||
{
|
||||
cPart* lpPart = at(x);
|
||||
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ bool cPlaceList::save()
|
||||
imageDelete.prepare("DELETE FROM placeImage WHERE placeID=:placeID;");
|
||||
imageAdd.prepare("INSERT INTO placeImage (placeID, name, description, image) VALUES (:placeID, :name, :description, :image);");
|
||||
|
||||
for(int x = 0;x < count();x++)
|
||||
for(int x = count()-1;x >= 0;x--)
|
||||
{
|
||||
cPlace* lpPlace = at(x);
|
||||
|
||||
|
||||
+1
-1
@@ -353,7 +353,7 @@ bool cRechercheList::save()
|
||||
placeDelete.prepare("DELETE FROM recherchePlace WHERE rechercheID=:rechercheID;");
|
||||
placeAdd.prepare("INSERT INTO recherchePlace (rechercheID, placeID, description) VALUES (:rechercheID, :placeID, :description);");
|
||||
|
||||
for(int x = 0;x < count();x++)
|
||||
for(int x = count()-1;x >= 0;x--)
|
||||
{
|
||||
cRecherche* lpRecherche = at(x);
|
||||
|
||||
|
||||
+2
-2
@@ -450,7 +450,7 @@ bool cSceneList::save()
|
||||
|
||||
queryUpdate.prepare("UPDATE scene SET name=:name, chapterID=:chapterID, sortOrder=:sortOrder, description=:description, state=:state, startedAt=:startedAt, finishedAt=:finishedAt, targetDate=:targetDate, text=:text WHERE id=:id;");
|
||||
queryInsert.prepare("INSERT INTO scene (name, chapterID, sortOrder, description, state, startedAt, finishedAt, targetDate, text) VALUES (:name, :chapterID, :sortOrder, :description, :state, :startedAt, :finishedAt, :targetDate, :text);");
|
||||
querySelect.prepare("SELECT id FROM scene WHERE _rowid_=(SELECT MAX(_rowid_) FROM part);");
|
||||
querySelect.prepare("SELECT id FROM scene WHERE _rowid_=(SELECT MAX(_rowid_) FROM scene);");
|
||||
queryDelete.prepare("DELETE FROM scene WHERE id=:id;");
|
||||
|
||||
QSqlQuery characterDelete;
|
||||
@@ -471,7 +471,7 @@ bool cSceneList::save()
|
||||
objectDelete.prepare("DELETE FROM sceneObject WHERE sceneID=:sceneID;");
|
||||
objectAdd.prepare("INSERT INTO sceneObject (sceneID, objectID, description) VALUES (:sceneID, :objectID, :description);");
|
||||
|
||||
for(int x = 0;x < count();x++)
|
||||
for(int x = count()-1;x >= 0;x--)
|
||||
{
|
||||
cScene* lpScene = at(x);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user