mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 00:58:32 -04:00
load(path,atPage) added in viewer,render and comic classes
updated CHANGELOG
This commit is contained in:
parent
e7fa648461
commit
e886f160cc
@ -1,3 +1,9 @@
|
||||
6.6 (No pública)
|
||||
Modificado YACReader para que abra los archivos comprimidos usando 7z.dll (.so, .dylib)
|
||||
YACReader abre ahora los cómics por la última página leída.
|
||||
Corregido bug que causaba que algunos cómics no se pudiesen abrir desde YACReaderLibrary en YACReader
|
||||
Corregido el modo en el que se actualizaba la "information label"
|
||||
|
||||
6.5
|
||||
Nueva interfaz principal de YACReaderLibrary y YACReader
|
||||
Corregido bug que causaba que el servidor no se activase en el primer arranque en MacOSX
|
||||
|
@ -19,8 +19,8 @@ Comic::Comic()
|
||||
setup();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
Comic::Comic(const QString & pathFile)
|
||||
:_pages(),_index(0),_path(pathFile),_loaded(false),bm(new Bookmarks()),_loadedPages(),_isPDF(false)
|
||||
Comic::Comic(const QString & pathFile, int atPage )
|
||||
:_pages(),_index(0),_path(pathFile),_loaded(false),bm(new Bookmarks()),_loadedPages(),_isPDF(false),_firstPage(atPage)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
@ -180,10 +180,10 @@ FileComic::FileComic()
|
||||
|
||||
}
|
||||
|
||||
FileComic::FileComic(const QString & path)
|
||||
:Comic(path)
|
||||
FileComic::FileComic(const QString & path, int atPage )
|
||||
:Comic(path,atPage)
|
||||
{
|
||||
load(path);
|
||||
load(path,atPage);
|
||||
}
|
||||
|
||||
FileComic::~FileComic()
|
||||
@ -191,14 +191,18 @@ FileComic::~FileComic()
|
||||
//Comic::~Comic();
|
||||
}
|
||||
|
||||
bool FileComic::load(const QString & path)
|
||||
bool FileComic::load(const QString & path, int atPage)
|
||||
{
|
||||
QFileInfo fi(path);
|
||||
|
||||
if(fi.exists())
|
||||
{
|
||||
bm->newComic(path);
|
||||
emit bookmarksUpdated();
|
||||
if(atPage == -1)
|
||||
{
|
||||
bm->newComic(path);
|
||||
emit bookmarksUpdated();
|
||||
}
|
||||
_firstPage = atPage;
|
||||
//emit bookmarksLoaded(*bm);
|
||||
|
||||
_path = QDir::cleanPath(path);
|
||||
@ -393,8 +397,9 @@ void FileComic::process()
|
||||
|
||||
out << "tiempo en ordenar : " << myTimer.elapsed() << endl;
|
||||
|
||||
_firstPage = bm->getLastPage();
|
||||
_index = bm->getLastPage();
|
||||
if(_firstPage == -1)
|
||||
_firstPage = bm->getLastPage();
|
||||
_index = _firstPage;
|
||||
emit(openAt(_index));
|
||||
|
||||
int sectionIndex;
|
||||
@ -463,10 +468,10 @@ FolderComic::FolderComic()
|
||||
|
||||
}
|
||||
|
||||
FolderComic::FolderComic(const QString & path)
|
||||
:Comic(path)
|
||||
FolderComic::FolderComic(const QString & path, int atPage )
|
||||
:Comic(path, atPage )
|
||||
{
|
||||
load(path);
|
||||
load(path, atPage );
|
||||
}
|
||||
|
||||
FolderComic::~FolderComic()
|
||||
@ -474,11 +479,15 @@ FolderComic::~FolderComic()
|
||||
|
||||
}
|
||||
|
||||
bool FolderComic::load(const QString & path)
|
||||
bool FolderComic::load(const QString & path, int atPage )
|
||||
{
|
||||
_path = path;
|
||||
bm->newComic(_path);
|
||||
emit bookmarksUpdated();
|
||||
if(atPage == -1)
|
||||
{
|
||||
bm->newComic(_path);
|
||||
emit bookmarksUpdated();
|
||||
}
|
||||
_firstPage = atPage;
|
||||
//emit bookmarksLoaded(*bm);
|
||||
return true;
|
||||
}
|
||||
@ -508,8 +517,11 @@ void FolderComic::process()
|
||||
}
|
||||
else
|
||||
{
|
||||
_firstPage = bm->getLastPage();
|
||||
_index = bm->getLastPage();
|
||||
if(_firstPage == -1)
|
||||
_firstPage = bm->getLastPage();
|
||||
|
||||
_index = _firstPage;
|
||||
|
||||
emit(openAt(_index));
|
||||
|
||||
emit pageChanged(0); // this indicates new comic, index=0
|
||||
@ -544,10 +556,10 @@ PDFComic::PDFComic()
|
||||
|
||||
}
|
||||
|
||||
PDFComic::PDFComic(const QString & path)
|
||||
:Comic(path)
|
||||
PDFComic::PDFComic(const QString & path, int atPage)
|
||||
:Comic(path,atPage)
|
||||
{
|
||||
load(path);
|
||||
load(path,atPage);
|
||||
}
|
||||
|
||||
PDFComic::~PDFComic()
|
||||
@ -555,11 +567,15 @@ PDFComic::~PDFComic()
|
||||
|
||||
}
|
||||
|
||||
bool PDFComic::load(const QString & path)
|
||||
bool PDFComic::load(const QString & path, int atPage)
|
||||
{
|
||||
_path = path;
|
||||
bm->newComic(_path);
|
||||
emit bookmarksUpdated();
|
||||
if(atPage == -1)
|
||||
{
|
||||
bm->newComic(_path);
|
||||
emit bookmarksUpdated();
|
||||
}
|
||||
_firstPage = atPage;
|
||||
//emit bookmarksLoaded(*bm);
|
||||
return true;
|
||||
}
|
||||
@ -590,8 +606,9 @@ void PDFComic::process()
|
||||
_pages.resize(nPages);
|
||||
_loadedPages = QVector<bool>(nPages,false);
|
||||
|
||||
_firstPage = bm->getLastPage();
|
||||
_index = bm->getLastPage();
|
||||
if(_firstPage == -1)
|
||||
_firstPage = bm->getLastPage();
|
||||
_index = _firstPage;
|
||||
emit(openAt(_index));
|
||||
|
||||
for(int i=_index;i<nPages;i++)
|
||||
|
@ -38,11 +38,11 @@
|
||||
|
||||
//Constructors
|
||||
Comic();
|
||||
Comic(const QString & pathFile);
|
||||
Comic(const QString & pathFile, int atPage = -1);
|
||||
~Comic();
|
||||
void setup();
|
||||
//Load pages from file
|
||||
virtual bool load(const QString & path) = 0;
|
||||
virtual bool load(const QString & path, int atPage = -1) = 0;
|
||||
|
||||
/*void loadFromFile(const QString & pathFile);
|
||||
void loadFromDir(const QString & pathDir);
|
||||
@ -90,10 +90,10 @@
|
||||
QList<QVector<quint32> > getSections(int & sectionIndex);
|
||||
public:
|
||||
FileComic();
|
||||
FileComic(const QString & path);
|
||||
FileComic(const QString & path, int atPage = -1);
|
||||
~FileComic();
|
||||
void fileExtracted(int index, const QByteArray & rawData);
|
||||
virtual bool load(const QString & path);
|
||||
virtual bool load(const QString & path, int atPage = -1);
|
||||
|
||||
public slots:
|
||||
void process();
|
||||
@ -109,10 +109,10 @@
|
||||
//void run();
|
||||
public:
|
||||
FolderComic();
|
||||
FolderComic(const QString & path);
|
||||
FolderComic(const QString & path, int atPage = -1);
|
||||
~FolderComic();
|
||||
|
||||
virtual bool load(const QString & path);
|
||||
virtual bool load(const QString & path, int atPage = -1);
|
||||
public slots:
|
||||
void process();
|
||||
|
||||
@ -129,10 +129,10 @@
|
||||
//void run();
|
||||
public:
|
||||
PDFComic();
|
||||
PDFComic(const QString & path);
|
||||
PDFComic(const QString & path, int atPage = -1);
|
||||
~PDFComic();
|
||||
|
||||
virtual bool load(const QString & path);
|
||||
virtual bool load(const QString & path, int atPage = -1);
|
||||
public slots:
|
||||
void process();
|
||||
};
|
||||
|
@ -13,6 +13,9 @@
|
||||
#include "help_about_dialog.h"
|
||||
#include "yacreader_tool_bar_stretch.h"
|
||||
|
||||
#include "comic_db.h"
|
||||
#include "yacreader_local_client.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <algorithm>
|
||||
|
||||
@ -115,7 +118,7 @@ void MainWindowViewer::setupUI()
|
||||
|
||||
setWindowTitle("YACReader");
|
||||
|
||||
if(QCoreApplication::argc()>1)
|
||||
if(QCoreApplication::argc() == 2) //only path...
|
||||
{
|
||||
//TODO: new method open(QString)
|
||||
QString pathFile = QCoreApplication::arguments().at(1);
|
||||
@ -124,12 +127,37 @@ void MainWindowViewer::setupUI()
|
||||
getSiblingComics(fi.absolutePath(),fi.fileName());
|
||||
|
||||
setWindowTitle("YACReader - " + fi.fileName());
|
||||
enableActions();
|
||||
viewer->open(pathFile);
|
||||
}
|
||||
/*else if(QCoreApplication::argc() == 5)
|
||||
{
|
||||
QString pathFile = QCoreApplication::arguments().at(1);
|
||||
currentDirectory = pathFile;
|
||||
quint64 comicId = QCoreApplication::arguments().at(2).toULongLong();
|
||||
quint64 libraryId = QCoreApplication::arguments().at(3).toULongLong();
|
||||
int page = QCoreApplication::arguments().at(4).toULongLong();
|
||||
|
||||
QFileInfo fi(pathFile);
|
||||
|
||||
enableActions();
|
||||
|
||||
//TODO request data to the server
|
||||
ComicDB comic;
|
||||
comic.id = comicId;
|
||||
YACReaderLocalClient client;
|
||||
|
||||
viewer->open(pathFile);
|
||||
|
||||
}
|
||||
//if(client.requestComicInfo(libraryId,comic))
|
||||
{
|
||||
if(comic.info.title == 0 || comic.info.title->isEmpty() )
|
||||
setWindowTitle("YACReader - " + fi.fileName());
|
||||
else
|
||||
setWindowTitle("YACReader - " + *comic.info.title);
|
||||
}
|
||||
//else
|
||||
setWindowTitle("YACReader : " + fi.fileName());
|
||||
viewer->open(pathFile,page);
|
||||
} */
|
||||
|
||||
versionChecker = new HttpVersionChecker();
|
||||
|
||||
|
@ -564,7 +564,7 @@ void Render::update()
|
||||
//-----------------------------------------------------------------------------
|
||||
// Comic interface
|
||||
//-----------------------------------------------------------------------------
|
||||
void Render::load(const QString & path)
|
||||
void Render::load(const QString & path, int atPage)
|
||||
{
|
||||
if(comic!=0)
|
||||
{
|
||||
@ -612,7 +612,7 @@ void Render::load(const QString & path)
|
||||
|
||||
pagesReady.clear();
|
||||
|
||||
comic->load(path); //garantiza que se va a intentar abrir el cómic
|
||||
comic->load(path,atPage); //garantiza que se va a intentar abrir el cómic
|
||||
|
||||
if(thread != NULL)
|
||||
thread->start();
|
||||
|
@ -132,7 +132,7 @@ public slots:
|
||||
//--comic interface
|
||||
void nextPage();
|
||||
void previousPage();
|
||||
void load(const QString & path);
|
||||
void load(const QString & path, int atPage);
|
||||
void rotateRight();
|
||||
void rotateLeft();
|
||||
unsigned int getIndex();
|
||||
|
@ -156,14 +156,14 @@ void Viewer::createConnections()
|
||||
connect(render,SIGNAL(bookmarksUpdated()),this,SLOT(setBookmarks()));
|
||||
}
|
||||
|
||||
void Viewer::open(QString pathFile)
|
||||
void Viewer::open(QString pathFile, int atPage)
|
||||
{
|
||||
if(render->hasLoadedComic())
|
||||
save();
|
||||
//bd->setBookmarks(*bm);
|
||||
|
||||
goToFlow->reset();
|
||||
render->load(pathFile);
|
||||
render->load(pathFile, atPage);
|
||||
//render->update();
|
||||
|
||||
verticalScrollBar()->setSliderPosition(verticalScrollBar()->minimum());
|
||||
|
@ -35,7 +35,7 @@ class NotificationsLabelWidget;
|
||||
public:
|
||||
bool fullscreen; //TODO, change by the right use of windowState();
|
||||
public slots:
|
||||
void open(QString pathFile);
|
||||
void open(QString pathFile, int atPage = -1);
|
||||
void prev();
|
||||
void next();
|
||||
void showGoToDialog();
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "yacreader_local_client.h"
|
||||
#include "comic_db.h"
|
||||
#include "yacreader_global.h"
|
||||
|
||||
#include <QLocalSocket>
|
||||
|
||||
@ -9,6 +10,7 @@ YACReaderLocalClient::YACReaderLocalClient(QObject *parent) :
|
||||
localSocket = new QLocalSocket(this);
|
||||
|
||||
connect(localSocket, SIGNAL(readyRead()), this, SLOT(readMessage()));
|
||||
|
||||
/*connect(socket, SIGNAL(error(QLocalSocket::LocalSocketError)),
|
||||
this, SLOT(displayError(QLocalSocket::LocalSocketError)));*/
|
||||
}
|
||||
@ -19,12 +21,45 @@ void YACReaderLocalClient::readMessage()
|
||||
|
||||
}
|
||||
|
||||
void YACReaderLocalClient::requestComicInfo(QString library, ComicDB & comic)
|
||||
bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic)
|
||||
{
|
||||
localSocket->connectToServer(YACREADERLIBRARY_GUID);
|
||||
if(localSocket->isOpen())
|
||||
{
|
||||
QByteArray block;
|
||||
QDataStream out(&block, QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_4_0);
|
||||
out << (quint16)0;
|
||||
out << libraryId;
|
||||
out << comic;
|
||||
out.device()->seek(0);
|
||||
out << (quint16)(block.size() - sizeof(quint16));
|
||||
|
||||
int written = 0;
|
||||
while(written != block.size())
|
||||
{
|
||||
written += localSocket->write(block);
|
||||
localSocket->flush();
|
||||
}
|
||||
localSocket->waitForReadyRead();
|
||||
QByteArray data;
|
||||
QDataStream in(data);
|
||||
in.setVersion(QDataStream::Qt_4_0);
|
||||
int totalSize = 0;
|
||||
while((data.size()-sizeof(quint16)) != totalSize )
|
||||
{
|
||||
data.append(localSocket->read(1000000000));
|
||||
if(data.size()>=sizeof(quint16) && totalSize == 0)
|
||||
in >> totalSize;
|
||||
}
|
||||
in >> comic;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void YACReaderLocalClient::sendComicInfo(QString library, ComicDB & comic)
|
||||
bool YACReaderLocalClient::sendComicInfo(quint64 libraryId, ComicDB & comic)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ signals:
|
||||
|
||||
public slots:
|
||||
void readMessage();
|
||||
void requestComicInfo(QString library, ComicDB & comic);
|
||||
void sendComicInfo(QString library, ComicDB & comic);
|
||||
bool requestComicInfo(quint64 libraryId, ComicDB & comic);
|
||||
bool sendComicInfo(quint64 libraryId, ComicDB & comic);
|
||||
|
||||
private:
|
||||
QLocalSocket * localSocket;
|
||||
|
@ -1004,15 +1004,20 @@ void LibraryWindow::openComic()
|
||||
{
|
||||
if(!importedCovers)
|
||||
{
|
||||
QString path = currentPath() + dmCV->getComicPath(comicView->currentIndex());
|
||||
ComicDB comic = dmCV->getComic(comicView->currentIndex());
|
||||
QString path = currentPath() + comic.path;
|
||||
/*quint64 comicId = comic.id;
|
||||
//TODO generate IDS for libraries...
|
||||
quint64 libraryId = selectedLibrary->currentIndex();
|
||||
int page = *(comic.info.numPages) / 2;*/
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
|
||||
QProcess::startDetached("open", QStringList() << "-n" << QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../YACReader.app") << "--args" << path);//,QStringList() << path);
|
||||
QProcess::startDetached("open", QStringList() << "-n" << QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../YACReader.app") << "--args" << path /*<< comicId << libraryId << page*/);//,QStringList() << path);
|
||||
//Comic is readed
|
||||
#else
|
||||
|
||||
QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath())+QString("/YACReader \"%1\"").arg(path),QStringList());
|
||||
QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath())+QString("/YACReader \"%1\"").arg(path)/*.arg(comicId).arg(libraryId).arg(page)*/,QStringList());
|
||||
#endif
|
||||
//Comic is readed
|
||||
setCurrentComicReaded();
|
||||
|
@ -4,6 +4,9 @@
|
||||
#include <QLocalSocket>
|
||||
|
||||
#include "yacreader_global.h"
|
||||
#include "db_helper.h"
|
||||
|
||||
#include "comic_db.h"
|
||||
|
||||
YACReaderLocalServer::YACReaderLocalServer(QObject *parent) :
|
||||
QObject(parent)
|
||||
@ -49,24 +52,52 @@ void YACReaderLocalServer::sendResponse()
|
||||
clientConnection->flush();
|
||||
clientConnection->disconnectFromServer();*/
|
||||
|
||||
QByteArray block;
|
||||
QDataStream out(&block, QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_4_0);
|
||||
out << (quint16)0;
|
||||
out << QString("ok");
|
||||
out.device()->seek(0);
|
||||
out << (quint16)(block.size() - sizeof(quint16));
|
||||
|
||||
QLocalSocket *clientConnection = localServer->nextPendingConnection();
|
||||
connect(clientConnection, SIGNAL(disconnected()),
|
||||
clientConnection, SLOT(deleteLater()));
|
||||
|
||||
clientConnection->write(block);
|
||||
clientConnection->flush();
|
||||
quint64 libraryId;
|
||||
ComicDB comic;
|
||||
clientConnection->waitForReadyRead();
|
||||
QByteArray data;
|
||||
QDataStream inputStream(data);
|
||||
inputStream.setVersion(QDataStream::Qt_4_0);
|
||||
int totalSize = 0;
|
||||
while((data.size()-sizeof(quint16)) != totalSize )
|
||||
{
|
||||
data.append(clientConnection->read(1000000000));
|
||||
if(data.size()>=sizeof(quint16) && totalSize == 0)
|
||||
inputStream >> totalSize;
|
||||
}
|
||||
inputStream >> libraryId;
|
||||
inputStream >> comic;
|
||||
|
||||
getComicInfo(libraryId,comic);
|
||||
|
||||
QByteArray block;
|
||||
QDataStream out(&block, QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_4_0);
|
||||
out << (quint16)0;
|
||||
out << comic;
|
||||
out.device()->seek(0);
|
||||
out << (quint16)(block.size() - sizeof(quint16));
|
||||
|
||||
int written = 0;
|
||||
while(written != block.size())
|
||||
{
|
||||
written += clientConnection->write(block);
|
||||
clientConnection->flush();
|
||||
}
|
||||
//clientConnection->waitForBytesWritten();
|
||||
clientConnection->disconnectFromServer();
|
||||
|
||||
}
|
||||
|
||||
void YACReaderLocalServer::getComicInfo(quint64 libraryId, ComicDB & comic)
|
||||
{
|
||||
comic = DBHelper::getComicInfo(DBHelper::getLibrariesNames().at(libraryId), comic.id);
|
||||
}
|
||||
|
||||
bool YACReaderLocalServer::isRunning()
|
||||
{
|
||||
QLocalSocket socket;
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <QObject>
|
||||
|
||||
class QLocalServer;
|
||||
class ComicDB;
|
||||
|
||||
class YACReaderLocalServer : public QObject
|
||||
{
|
||||
@ -17,7 +18,7 @@ public slots:
|
||||
bool isListening();
|
||||
void sendResponse();
|
||||
static bool isRunning();
|
||||
|
||||
void getComicInfo(quint64 libraryId, ComicDB & comic);
|
||||
private:
|
||||
QLocalServer * localServer;
|
||||
|
||||
|
@ -405,4 +405,163 @@ QPixmap ComicInfo::getCover(const QString & basePath)
|
||||
QPixmap c;
|
||||
c.convertFromImage(cover);
|
||||
return c;
|
||||
}
|
||||
QDataStream &operator<<(QDataStream & stream, const ComicDB & comic)
|
||||
{
|
||||
stream << comic.id;
|
||||
stream << comic.name;
|
||||
stream << comic.parentId;
|
||||
stream << comic.path;
|
||||
stream << comic._hasCover;
|
||||
stream << comic.info;
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream & stream, ComicDB & comic)
|
||||
{
|
||||
stream >> comic.id;
|
||||
stream >> comic.name;
|
||||
stream >> comic.parentId;
|
||||
stream >> comic.path;
|
||||
stream >> comic._hasCover;
|
||||
stream >> comic.info;
|
||||
return stream;
|
||||
}
|
||||
|
||||
void serializeField(QDataStream & stream, QString * field)
|
||||
{
|
||||
stream << (field!=0);
|
||||
if (field!=0) stream << *field;
|
||||
}
|
||||
|
||||
void serializeField(QDataStream & stream, int * field)
|
||||
{
|
||||
stream << (field!=0);
|
||||
if (field!=0) stream << *field;
|
||||
}
|
||||
|
||||
void serializeField(QDataStream & stream, bool * field)
|
||||
{
|
||||
stream << (field!=0);
|
||||
if (field!=0) stream << *field;
|
||||
}
|
||||
|
||||
void deserializeField(QDataStream & stream, QString * & field)
|
||||
{
|
||||
bool isData;
|
||||
stream >> isData;
|
||||
if(isData)
|
||||
{
|
||||
field = new QString();
|
||||
stream >> *field;
|
||||
}
|
||||
}
|
||||
|
||||
void deserializeField(QDataStream & stream, int * & field)
|
||||
{
|
||||
bool isData;
|
||||
stream >> isData;
|
||||
if(isData)
|
||||
{
|
||||
field = new int;
|
||||
stream >> *field;
|
||||
}
|
||||
}
|
||||
|
||||
void deserializeField(QDataStream & stream, bool * & field)
|
||||
{
|
||||
bool isData;
|
||||
stream >> isData;
|
||||
if(isData)
|
||||
{
|
||||
field = new bool;
|
||||
stream >> *field;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QDataStream &operator<<(QDataStream & stream, const ComicInfo & comicInfo)
|
||||
{
|
||||
stream << comicInfo.id;
|
||||
stream << comicInfo.read;
|
||||
stream << comicInfo.edited;
|
||||
stream << comicInfo.hash;
|
||||
stream << comicInfo.existOnDb;
|
||||
|
||||
serializeField(stream,comicInfo.title);
|
||||
|
||||
serializeField(stream,comicInfo.coverPage);
|
||||
serializeField(stream,comicInfo.numPages);
|
||||
|
||||
serializeField(stream,comicInfo.number);
|
||||
serializeField(stream,comicInfo.isBis);
|
||||
serializeField(stream,comicInfo.count);
|
||||
|
||||
serializeField(stream,comicInfo.volume);
|
||||
serializeField(stream,comicInfo.storyArc);
|
||||
serializeField(stream,comicInfo.arcNumber);
|
||||
serializeField(stream,comicInfo.arcCount);
|
||||
|
||||
serializeField(stream,comicInfo.genere);
|
||||
|
||||
serializeField(stream,comicInfo.writer);
|
||||
serializeField(stream,comicInfo.penciller);
|
||||
serializeField(stream,comicInfo.inker);
|
||||
serializeField(stream,comicInfo.colorist);
|
||||
serializeField(stream,comicInfo.letterer);
|
||||
serializeField(stream,comicInfo.coverArtist);
|
||||
|
||||
serializeField(stream,comicInfo.date);
|
||||
serializeField(stream,comicInfo.publisher);
|
||||
serializeField(stream,comicInfo.format);
|
||||
serializeField(stream,comicInfo.color);
|
||||
serializeField(stream,comicInfo.ageRating);
|
||||
|
||||
serializeField(stream,comicInfo.synopsis);
|
||||
serializeField(stream,comicInfo.characters);
|
||||
serializeField(stream,comicInfo.notes);
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream & stream, ComicInfo & comicInfo)
|
||||
{
|
||||
stream >> comicInfo.id;
|
||||
stream >> comicInfo.read;
|
||||
stream >> comicInfo.edited;
|
||||
stream >> comicInfo.hash;
|
||||
stream >> comicInfo.existOnDb;
|
||||
|
||||
deserializeField(stream,comicInfo.title);
|
||||
|
||||
deserializeField(stream,comicInfo.coverPage);
|
||||
deserializeField(stream,comicInfo.numPages);
|
||||
|
||||
deserializeField(stream,comicInfo.number);
|
||||
deserializeField(stream,comicInfo.isBis);
|
||||
deserializeField(stream,comicInfo.count);
|
||||
|
||||
deserializeField(stream,comicInfo.volume);
|
||||
deserializeField(stream,comicInfo.storyArc);
|
||||
deserializeField(stream,comicInfo.arcNumber);
|
||||
deserializeField(stream,comicInfo.arcCount);
|
||||
|
||||
deserializeField(stream,comicInfo.genere);
|
||||
|
||||
deserializeField(stream,comicInfo.writer);
|
||||
deserializeField(stream,comicInfo.penciller);
|
||||
deserializeField(stream,comicInfo.inker);
|
||||
deserializeField(stream,comicInfo.colorist);
|
||||
deserializeField(stream,comicInfo.letterer);
|
||||
deserializeField(stream,comicInfo.coverArtist);
|
||||
|
||||
deserializeField(stream,comicInfo.date);
|
||||
deserializeField(stream,comicInfo.publisher);
|
||||
deserializeField(stream,comicInfo.format);
|
||||
deserializeField(stream,comicInfo.color);
|
||||
deserializeField(stream,comicInfo.ageRating);
|
||||
|
||||
deserializeField(stream,comicInfo.synopsis);
|
||||
deserializeField(stream,comicInfo.characters);
|
||||
deserializeField(stream,comicInfo.notes);
|
||||
return stream;
|
||||
}
|
@ -91,6 +91,10 @@ public:
|
||||
|
||||
QPixmap getCover(const QString & basePath);
|
||||
|
||||
friend QDataStream &operator<<(QDataStream & stream, const ComicInfo & comicInfo);
|
||||
|
||||
friend QDataStream &operator>>(QDataStream & stream, ComicInfo & comicInfo);
|
||||
|
||||
private:
|
||||
void setValue(QString * & field, const QString & value);
|
||||
void setValue(int * & field, int value);
|
||||
@ -115,6 +119,9 @@ public:
|
||||
QString toTXT();
|
||||
|
||||
ComicInfo info;
|
||||
|
||||
friend QDataStream &operator<<(QDataStream &, const ComicDB &);
|
||||
friend QDataStream &operator>>(QDataStream &, ComicDB &);
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user