This commit is contained in:
Luis Ángel San Martín 2014-06-10 21:51:03 +02:00
commit 72b2abb8cd
2 changed files with 3 additions and 1 deletions

View File

@ -569,6 +569,7 @@ void TableModel::reload(const ComicDB & comic)
if(item->data(TableModel::Id).toULongLong() == comic.id)
{
found = true;
item->setData(TableModel::ReadColumn,comic.info.read);
item->setData(TableModel::CurrentPage,comic.info.currentPage);
item->setData(TableModel::HasBeenOpened,true);
break;

View File

@ -252,7 +252,8 @@ void DBHelper::update(ComicInfo * comicInfo, QSqlDatabase & db)
updateComicInfo.bindValue(":characters",comicInfo->characters);
updateComicInfo.bindValue(":notes",comicInfo->notes);
updateComicInfo.bindValue(":read", comicInfo->read?1:0);
bool read = comicInfo->read || comicInfo->currentPage == comicInfo->numPages.toInt(); //if current page is the las page, the comic is read(completed)
updateComicInfo.bindValue(":read", read?1:0);
updateComicInfo.bindValue(":id", comicInfo->id);
updateComicInfo.bindValue(":edited", comicInfo->edited?1:0);