diff --git a/YACReaderLibrary/db/treemodel.cpp b/YACReaderLibrary/db/treemodel.cpp index d403eba8..7f14c2cc 100644 --- a/YACReaderLibrary/db/treemodel.cpp +++ b/YACReaderLibrary/db/treemodel.cpp @@ -256,7 +256,7 @@ void TreeModel::setupModelData(QSqlQuery &sqlquery, TreeItem *parent) item->id = record.value("id").toULongLong(); //la inserción de hijos se hace de forma ordenada TreeItem * parent = items.value(record.value("parentId").toULongLong()); - if(parent !=0) + if(parent !=0) //TODO if parent==0 the parent of item was removed from the DB and delete on cascade didn't work, ERROR. parent->appendChild(item); //se añade el item al map, de forma que se pueda encontrar como padre en siguientes iteraciones items.insert(item->id,item); diff --git a/YACReaderLibrary/library_creator.cpp b/YACReaderLibrary/library_creator.cpp index 8ee77109..576377e8 100644 --- a/YACReaderLibrary/library_creator.cpp +++ b/YACReaderLibrary/library_creator.cpp @@ -92,7 +92,7 @@ void LibraryCreator::run() creation = false; return; } - //QSqlQuery pragma("PRAGMA foreign_keys = ON",_database); + QSqlQuery pragma("PRAGMA foreign_keys = ON",_database); _database.transaction(); update(QDir(_source)); _database.commit();