mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 05:24:57 -04:00
Add new fields to the DB and make then available to be used in the apps
This commit is contained in:
@ -118,6 +118,51 @@ QString ComicDB::toTXT()
|
||||
if (!info.lastTimeOpened.isNull())
|
||||
txt.append(QString("lastTimeOpened:%1\r\n").arg(info.lastTimeOpened.toULongLong()));
|
||||
|
||||
if (!info.added.isNull())
|
||||
txt.append(QString("added:%1\r\n").arg(info.added.toULongLong()));
|
||||
|
||||
if (!info.type.isNull())
|
||||
txt.append(QString("type:%1\r\n").arg(info.type.toInt()));
|
||||
|
||||
if (!info.editor.isNull())
|
||||
txt.append(QString("editor:%1\r\n").arg(info.editor.toString()));
|
||||
|
||||
if (!info.imprint.isNull())
|
||||
txt.append(QString("imprint:%1\r\n").arg(info.imprint.toString()));
|
||||
|
||||
if (!info.teams.isNull())
|
||||
txt.append(QString("teams:%1\r\n").arg(info.teams.toString()));
|
||||
|
||||
if (!info.locations.isNull())
|
||||
txt.append(QString("locations:%1\r\n").arg(info.locations.toString()));
|
||||
|
||||
if (!info.series.isNull())
|
||||
txt.append(QString("series:%1\r\n").arg(info.series.toString()));
|
||||
|
||||
if (!info.alternateSeries.isNull())
|
||||
txt.append(QString("alternateSeries:%1\r\n").arg(info.alternateSeries.toString()));
|
||||
|
||||
if (!info.alternateNumber.isNull())
|
||||
txt.append(QString("alternateNumber:%1\r\n").arg(info.alternateNumber.toString()));
|
||||
|
||||
if (!info.alternateCount.isNull())
|
||||
txt.append(QString("alternateCount:%1\r\n").arg(info.alternateCount.toString()));
|
||||
|
||||
if (!info.languageISO.isNull())
|
||||
txt.append(QString("languageISO:%1\r\n").arg(info.languageISO.toString()));
|
||||
|
||||
if (!info.seriesGroup.isNull())
|
||||
txt.append(QString("seriesGroup:%1\r\n").arg(info.seriesGroup.toString()));
|
||||
|
||||
if (!info.mainCharacterOrTeam.isNull())
|
||||
txt.append(QString("mainCharacterOrTeam:%1\r\n").arg(info.mainCharacterOrTeam.toString()));
|
||||
|
||||
if (!info.review.isNull())
|
||||
txt.append(QString("review:%1\r\n").arg(info.review.toString()));
|
||||
|
||||
if (!info.tags.isNull())
|
||||
txt.append(QString("tags:%1\r\n").arg(info.tags.toString()));
|
||||
|
||||
return txt;
|
||||
}
|
||||
|
||||
@ -238,6 +283,22 @@ void ComicInfo::deleteMetadata()
|
||||
characters = QVariant();
|
||||
notes = QVariant();
|
||||
|
||||
// type = QVariant(); reset or not???
|
||||
editor = QVariant();
|
||||
imprint = QVariant();
|
||||
teams = QVariant();
|
||||
locations = QVariant();
|
||||
series = QVariant();
|
||||
alternateSeries = QVariant();
|
||||
alternateNumber = QVariant();
|
||||
alternateCount = QVariant();
|
||||
languageISO = QVariant();
|
||||
seriesGroup = QVariant();
|
||||
mainCharacterOrTeam = QVariant();
|
||||
review = QVariant();
|
||||
|
||||
// tags = QVariant(); reset or not???
|
||||
|
||||
comicVineID = QVariant();
|
||||
}
|
||||
// the default operator= should work
|
||||
@ -292,135 +353,25 @@ ComicInfo &ComicInfo::operator=(const ComicInfo &comicInfo)
|
||||
coverSizeRatio = comicInfo.coverSizeRatio;
|
||||
originalCoverSize = comicInfo.originalCoverSize;
|
||||
|
||||
added = comicInfo.added;
|
||||
type = comicInfo.type;
|
||||
editor = comicInfo.editor;
|
||||
imprint = comicInfo.imprint;
|
||||
teams = comicInfo.teams;
|
||||
locations = comicInfo.locations;
|
||||
series = comicInfo.series;
|
||||
alternateSeries = comicInfo.alternateSeries;
|
||||
alternateNumber = comicInfo.alternateNumber;
|
||||
alternateCount = comicInfo.alternateCount;
|
||||
languageISO = comicInfo.languageISO;
|
||||
seriesGroup = comicInfo.seriesGroup;
|
||||
mainCharacterOrTeam = comicInfo.mainCharacterOrTeam;
|
||||
review = comicInfo.review;
|
||||
tags = comicInfo.tags;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// set fields
|
||||
/*
|
||||
void ComicInfo::setTitle(QString value)
|
||||
{
|
||||
setValue(title,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setCoverPage(int value)
|
||||
{
|
||||
setValue(coverPage,value);
|
||||
}
|
||||
void ComicInfo::setNumPages(int value)
|
||||
{
|
||||
setValue(numPages,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setNumber(int value)
|
||||
{
|
||||
setValue(number,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setIsBis(bool value)
|
||||
{
|
||||
setValue(isBis,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setCount(int value)
|
||||
{
|
||||
setValue(count,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setVolume(QString value)
|
||||
{
|
||||
setValue(volume,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setStoryArc(QString value)
|
||||
{
|
||||
setValue(storyArc,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setArcNumber(int value)
|
||||
{
|
||||
setValue(arcNumber,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setArcCount(int value)
|
||||
{
|
||||
setValue(arcCount,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setGenere(QString value)
|
||||
{
|
||||
setValue(genere,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setWriter(QString value)
|
||||
{
|
||||
setValue(writer,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setPenciller(QString value)
|
||||
{
|
||||
setValue(penciller,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setInker(QString value)
|
||||
{
|
||||
setValue(inker,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setColorist(QString value)
|
||||
{
|
||||
setValue(colorist,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setLetterer(QString value)
|
||||
{
|
||||
setValue(letterer,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setCoverArtist(QString value)
|
||||
{
|
||||
setValue(coverArtist,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setDate(QString value)
|
||||
{
|
||||
setValue(date,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setPublisher(QString value)
|
||||
{
|
||||
setValue(publisher,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setFormat(QString value)
|
||||
{
|
||||
setValue(format,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setColor(bool value)
|
||||
{
|
||||
setValue(color,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setAgeRating(QString value)
|
||||
{
|
||||
setValue(ageRating,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setSynopsis(QString value)
|
||||
{
|
||||
setValue(synopsis,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setCharacters(QString value)
|
||||
{
|
||||
setValue(characters,value);
|
||||
}
|
||||
|
||||
void ComicInfo::setNotes(QString value)
|
||||
{
|
||||
setValue(notes,value);
|
||||
}*/
|
||||
|
||||
QPixmap ComicInfo::getCover(const QString &basePath)
|
||||
{
|
||||
if (cover.isNull()) {
|
||||
@ -494,6 +445,33 @@ QStringList ComicInfo::getCharacters()
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QStringList ComicInfo::getTeams()
|
||||
{
|
||||
if (teams.toString().length() > 0) {
|
||||
return teams.toString().split("\n");
|
||||
}
|
||||
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QStringList ComicInfo::getLocations()
|
||||
{
|
||||
if (locations.toString().length() > 0) {
|
||||
return locations.toString().split("\n");
|
||||
}
|
||||
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QStringList ComicInfo::getTags()
|
||||
{
|
||||
if (tags.toString().length() > 0) {
|
||||
return tags.toString().split("\n");
|
||||
}
|
||||
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
void ComicInfo::setRead(bool r)
|
||||
{
|
||||
if (r != read) {
|
||||
@ -599,6 +577,24 @@ QDataStream &operator<<(QDataStream &stream, const ComicInfo &comicInfo)
|
||||
stream << comicInfo.coverSizeRatio;
|
||||
stream << comicInfo.originalCoverSize;
|
||||
|
||||
stream << comicInfo.added;
|
||||
stream << comicInfo.type;
|
||||
stream << comicInfo.added;
|
||||
stream << comicInfo.type;
|
||||
stream << comicInfo.editor;
|
||||
stream << comicInfo.imprint;
|
||||
stream << comicInfo.teams;
|
||||
stream << comicInfo.locations;
|
||||
stream << comicInfo.series;
|
||||
stream << comicInfo.alternateSeries;
|
||||
stream << comicInfo.alternateNumber;
|
||||
stream << comicInfo.alternateCount;
|
||||
stream << comicInfo.languageISO;
|
||||
stream << comicInfo.seriesGroup;
|
||||
stream << comicInfo.mainCharacterOrTeam;
|
||||
stream << comicInfo.review;
|
||||
stream << comicInfo.tags;
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
@ -661,5 +657,23 @@ QDataStream &operator>>(QDataStream &stream, ComicInfo &comicInfo)
|
||||
stream >> comicInfo.coverSizeRatio;
|
||||
stream >> comicInfo.originalCoverSize;
|
||||
|
||||
stream >> comicInfo.added;
|
||||
stream >> comicInfo.type;
|
||||
stream >> comicInfo.added;
|
||||
stream >> comicInfo.type;
|
||||
stream >> comicInfo.editor;
|
||||
stream >> comicInfo.imprint;
|
||||
stream >> comicInfo.teams;
|
||||
stream >> comicInfo.locations;
|
||||
stream >> comicInfo.series;
|
||||
stream >> comicInfo.alternateSeries;
|
||||
stream >> comicInfo.alternateNumber;
|
||||
stream >> comicInfo.alternateCount;
|
||||
stream >> comicInfo.languageISO;
|
||||
stream >> comicInfo.seriesGroup;
|
||||
stream >> comicInfo.mainCharacterOrTeam;
|
||||
stream >> comicInfo.review;
|
||||
stream >> comicInfo.tags;
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
Reference in New Issue
Block a user