mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Implemented logic for comic info interactive items (read, fav, rating)
This commit is contained in:
@ -463,6 +463,15 @@ void ComicInfo::setRating(int r)
|
||||
}
|
||||
}
|
||||
|
||||
void ComicInfo::setFavorite(bool f)
|
||||
{
|
||||
if(f != isFavorite)
|
||||
{
|
||||
isFavorite = f;
|
||||
emit favoriteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream & stream, const ComicDB & comic)
|
||||
{
|
||||
stream << comic.id;
|
||||
|
@ -186,14 +186,20 @@ public:
|
||||
|
||||
Q_PROPERTY(QImage cover MEMBER cover CONSTANT)
|
||||
|
||||
//-new properties, not loaded from the DB automatically
|
||||
bool isFavorite;
|
||||
Q_PROPERTY(bool isFavorite MEMBER isFavorite WRITE setFavorite NOTIFY favoriteChanged)
|
||||
|
||||
//setters, used in QML only by now
|
||||
void setRead(bool r);
|
||||
void setRating(int r);
|
||||
void setFavorite(bool f);
|
||||
private:
|
||||
|
||||
signals:
|
||||
void readChanged();
|
||||
void ratingChanged();
|
||||
void favoriteChanged();
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user