mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Add current/next comic view to GridView.
This commit is contained in:
@ -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));
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <QVariant>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlDatabase>
|
||||
#include <QUrl>
|
||||
|
||||
#include "yacreader_global_gui.h"
|
||||
|
||||
@ -70,6 +71,8 @@ public:
|
||||
void reload(const ComicDB & comic);
|
||||
void resetComicRating(const QModelIndex & mi);
|
||||
|
||||
Q_INVOKABLE QUrl getCoverUrlPathForComicHash(const QString& hash) const;
|
||||
|
||||
|
||||
void addComicsToFavorites(const QList<QModelIndex> &comicsList);
|
||||
void addComicsToLabel(const QList<QModelIndex> &comicsList, qulonglong labelId);
|
||||
|
Reference in New Issue
Block a user