Add current/next comic view to GridView.

This commit is contained in:
Luis Ángel San Martín
2018-04-23 19:22:51 +02:00
parent b41884d5db
commit f6d389ff35
23 changed files with 933 additions and 32 deletions

View File

@ -295,7 +295,7 @@ QVariant ComicModel::data(const QModelIndex &index, int role) const
else if (role == RatingRole)
return item->data(Rating);
else if (role == CoverPathRole)
return QUrl("file:"+_databasePath+"/covers/"+item->data(Hash).toString()+".jpg");
return getCoverUrlPathForComicHash(item->data(Hash).toString());
else if (role == NumPagesRole)
return item->data(NumPages);
else if (role == CurrentPageRole)
@ -994,6 +994,11 @@ void ComicModel::resetComicRating(const QModelIndex &mi)
QSqlDatabase::removeDatabase(_databasePath);
}
QUrl ComicModel::getCoverUrlPathForComicHash(const QString &hash) const
{
return QUrl("file:"+_databasePath+"/covers/"+hash+".jpg");
}
void ComicModel::addComicsToFavorites(const QList<qulonglong> &comicIds)
{
addComicsToFavorites(getIndexesFromIds(comicIds));