Merged in selmf/yacreader/small-fixes-9.0 (pull request #52)

Small fixes 9.0:
This commit is contained in:
Luis Ángel San Martín
2017-09-27 18:58:41 +00:00
5 changed files with 72 additions and 22 deletions

View File

@ -243,6 +243,9 @@ void DBHelper::update(qulonglong libraryId, ComicInfo & comicInfo)
void DBHelper::update(ComicInfo * comicInfo, QSqlDatabase & db)
{
if(comicInfo == nullptr)
return;
QSqlQuery updateComicInfo(db);
updateComicInfo.prepare("UPDATE comic_info SET "
"title = :title,"
@ -385,7 +388,7 @@ void DBHelper::updateProgress(qulonglong libraryId, const ComicInfo &comicInfo)
comic.info.currentPage = comicInfo.currentPage;
comic.info.hasBeenOpened = true;
DBHelper::update(&comic.info,db);
DBHelper::updateReadingRemoteProgress(comic.info,db);
db.close();
QSqlDatabase::removeDatabase(libraryPath);
@ -407,6 +410,8 @@ void DBHelper::updateReadingRemoteProgress(const ComicInfo &comicInfo, QSqlDatab
updateComicInfo.bindValue(":id", comicInfo.id);
updateComicInfo.bindValue(":rating", comicInfo.rating);
updateComicInfo.exec();
updateComicInfo.clear();
}

View File

@ -244,6 +244,7 @@ void HttpSession::dismissCurrentComic()
{
if(dataPtr->yacreaderSessionData.comic != 0)
{
dataPtr->yacreaderSessionData.comic->invalidate();
dataPtr->yacreaderSessionData.comic->deleteLater();
dataPtr->yacreaderSessionData.comic = 0;
}
@ -283,6 +284,7 @@ void HttpSession::dismissCurrentRemoteComic()
{
if(dataPtr->yacreaderSessionData.remoteComic != 0)
{
dataPtr->yacreaderSessionData.remoteComic->invalidate();
dataPtr->yacreaderSessionData.remoteComic->deleteLater();
dataPtr->yacreaderSessionData.remoteComic = 0;
}