updating folders' children info for every insert/delete in the db causes big performance issues, so that info is going to be updated explicitly

This commit is contained in:
Luis Ángel San Martín
2016-01-25 18:45:50 +01:00
parent 00f45b9a27
commit 88056c819f
10 changed files with 63 additions and 37 deletions

View File

@ -1291,7 +1291,7 @@ void LibraryWindow::loadLibrary(const QString & name)
if(d.exists(path+"/library.ydb"))
{
QSqlDatabase db = DataBaseManagement::loadDatabase(path);
QSqlDatabase db = DataBaseManagement::loadDatabase(path);
manageOpeningLibraryError(db.lastError().databaseText() + "-" + db.lastError().driverText());
//será possible renombrar y borrar estas bibliotecas
renameLibraryAction->setEnabled(true);
@ -2579,7 +2579,7 @@ void LibraryWindow::deleteComicsFromDisk()
QLOG_INFO() << comic.parentId;
}
ComicsRemover * remover = new ComicsRemover(indexList,paths);
ComicsRemover * remover = new ComicsRemover(indexList,paths,comics.at(0).parentId);
QThread * thread = NULL;
thread = new QThread(this);
@ -2592,6 +2592,8 @@ void LibraryWindow::deleteComicsFromDisk()
connect(remover, SIGNAL(remove(int)), comicsModel, SLOT(remove(int)));
connect(remover, SIGNAL(removeError()),this,SLOT(setRemoveError()));
connect(remover, SIGNAL(finished()), comicsModel, SLOT(finishTransaction()));
connect(remover, SIGNAL(finished()), comicsModel, SLOT(finishTransaction()));
connect(remover, SIGNAL(removedItemsFromFolder(qulonglong)), foldersModel, SLOT(updateFolderChildrenInfo(qulonglong)));
connect(remover, SIGNAL(finished()),this,SLOT(checkEmptyFolder()));
connect(remover, SIGNAL(finished()),this,SLOT(checkRemoveError()));