Updated the comic model for getting the reading comics properly sorted. //TODO This should be using the method in the DBHelper.

This commit is contained in:
Luis Ángel San Martín 2017-03-28 18:43:15 +02:00
parent e2a8d520a9
commit 30982be0a9

View File

@ -607,9 +607,11 @@ void ComicModel::setupReadingModelData(const QString &databasePath)
QSqlQuery selectQuery(db);
selectQuery.prepare("SELECT ci.number,ci.title,c.fileName,ci.numPages,c.id,c.parentId,c.path,ci.hash,ci.read,ci.isBis,ci.currentPage,ci.rating,ci.hasBeenOpened "
"FROM comic c INNER JOIN comic_info ci ON (c.comicInfoId = ci.id) "
"WHERE ci.hasBeenOpened = 1 AND ci.read = 0 AND ci.currentPage != ci.numPages AND ci.currentPage != 1");
"WHERE ci.hasBeenOpened = 1 AND ci.read = 0 AND ci.currentPage != ci.numPages AND ci.currentPage != 1 "
"ORDER BY ci.lastTimeOpened DESC");
selectQuery.exec();
setupModelData(selectQuery);
setupModelDataForList(selectQuery);
}
db.close();
QSqlDatabase::removeDatabase(_databasePath);