mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Add new struct to represent the source where a comic can be opened from
A comic always belongs to a Folder, but when we open one its siblings may be different in we are opening it from a Reading List. I am not sure that Tags should keep the reading order because their purpose is abstract, so their behaviour will be opening the comics from theirs container folders.
This commit is contained in:
parent
50840e955d
commit
51284cb652
@ -88,3 +88,19 @@ QString YACReader::labelColorToRGBString(LabelColors color)
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
QDataStream &YACReader::operator<<(QDataStream &stream, const OpenComicSource &source)
|
||||
{
|
||||
stream << (quint8)source.source;
|
||||
stream << source.sourceId;
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream &YACReader::operator>>(QDataStream &stream, OpenComicSource &source)
|
||||
{
|
||||
quint8 sourceRaw;
|
||||
stream >> sourceRaw;
|
||||
source.source = (OpenComicSource::Source)sourceRaw;
|
||||
stream >> source.sourceId;
|
||||
return stream;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define __YACREADER_GLOBAL_H
|
||||
|
||||
#include <QStandardPaths>
|
||||
#include <QDataStream>
|
||||
|
||||
#define VERSION "9.8.0"
|
||||
|
||||
@ -54,9 +55,26 @@ enum LabelColors {
|
||||
YDark
|
||||
};
|
||||
|
||||
struct OpenComicSource {
|
||||
enum Source {
|
||||
Folder = 0,
|
||||
ReadingList
|
||||
};
|
||||
|
||||
Source source;
|
||||
qulonglong sourceId;
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &stream, const OpenComicSource &source);
|
||||
QDataStream &operator>>(QDataStream &stream, OpenComicSource &source);
|
||||
|
||||
QString getSettingsPath();
|
||||
QString colorToName(LabelColors colors);
|
||||
QString labelColorToRGBString(LabelColors color);
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(YACReader::OpenComicSource::Source)
|
||||
Q_DECLARE_METATYPE(YACReader::OpenComicSource)
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user