mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 05:24:57 -04:00
Updated comic info for writing read and rating properties in QML.
This commit is contained in:
@ -445,6 +445,24 @@ QStringList ComicInfo::getCharacters()
|
|||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ComicInfo::setRead(bool r)
|
||||||
|
{
|
||||||
|
if(r != read)
|
||||||
|
{
|
||||||
|
read = r;
|
||||||
|
emit readChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ComicInfo::setRating(int r)
|
||||||
|
{
|
||||||
|
if(r != rating)
|
||||||
|
{
|
||||||
|
rating = r;
|
||||||
|
emit ratingChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QDataStream &operator<<(QDataStream & stream, const ComicDB & comic)
|
QDataStream &operator<<(QDataStream & stream, const ComicDB & comic)
|
||||||
{
|
{
|
||||||
stream << comic.id;
|
stream << comic.id;
|
||||||
|
@ -132,12 +132,12 @@ public:
|
|||||||
friend QDataStream &operator>>(QDataStream & stream, ComicInfo & comicInfo);
|
friend QDataStream &operator>>(QDataStream & stream, ComicInfo & comicInfo);
|
||||||
|
|
||||||
Q_PROPERTY(qulonglong id MEMBER id CONSTANT)
|
Q_PROPERTY(qulonglong id MEMBER id CONSTANT)
|
||||||
Q_PROPERTY(bool read MEMBER read CONSTANT)
|
Q_PROPERTY(bool read MEMBER read WRITE setRead NOTIFY readChanged)
|
||||||
Q_PROPERTY(bool edited MEMBER edited CONSTANT)
|
Q_PROPERTY(bool edited MEMBER edited CONSTANT)
|
||||||
Q_PROPERTY(QString hash MEMBER hash CONSTANT)
|
Q_PROPERTY(QString hash MEMBER hash CONSTANT)
|
||||||
Q_PROPERTY(bool existOnDb MEMBER existOnDb CONSTANT)
|
Q_PROPERTY(bool existOnDb MEMBER existOnDb CONSTANT)
|
||||||
|
|
||||||
Q_PROPERTY(int rating MEMBER rating CONSTANT)
|
Q_PROPERTY(int rating MEMBER rating WRITE setRating NOTIFY ratingChanged)
|
||||||
|
|
||||||
Q_PROPERTY(bool hasBeenOpened MEMBER hasBeenOpened CONSTANT)
|
Q_PROPERTY(bool hasBeenOpened MEMBER hasBeenOpened CONSTANT)
|
||||||
|
|
||||||
@ -186,8 +186,15 @@ public:
|
|||||||
|
|
||||||
Q_PROPERTY(QImage cover MEMBER cover CONSTANT)
|
Q_PROPERTY(QImage cover MEMBER cover CONSTANT)
|
||||||
|
|
||||||
|
//setters, used in QML only by now
|
||||||
|
void setRead(bool r);
|
||||||
|
void setRating(int r);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void readChanged();
|
||||||
|
void ratingChanged();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ComicDB : public LibraryItem
|
class ComicDB : public LibraryItem
|
||||||
|
Reference in New Issue
Block a user