mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
added sedComicInfo
This commit is contained in:
parent
8d6b1c5690
commit
97db3f582a
@ -357,22 +357,15 @@ QList<QVector<quint32> > FileComic::getSections(int & sectionIndex)
|
|||||||
|
|
||||||
void FileComic::process()
|
void FileComic::process()
|
||||||
{
|
{
|
||||||
QFile f("c:/temp/out.txt");
|
|
||||||
f.open(QIODevice::WriteOnly);
|
|
||||||
QTextStream out(&f);
|
|
||||||
|
|
||||||
QTime myTimer;
|
QTime myTimer;
|
||||||
myTimer.start();
|
myTimer.start();
|
||||||
// do something..
|
// do something..
|
||||||
|
|
||||||
CompressedArchive archive(_path);
|
CompressedArchive archive(_path);
|
||||||
out << "tiempo en abrir : " << myTimer.elapsed() << endl;
|
|
||||||
//se filtran para obtener sólo los formatos soportados
|
//se filtran para obtener sólo los formatos soportados
|
||||||
_order = archive.getFileNames();
|
_order = archive.getFileNames();
|
||||||
_fileNames = filter(_order);
|
_fileNames = filter(_order);
|
||||||
|
|
||||||
out << "tiempo en filtrar : " << myTimer.elapsed() << endl;
|
|
||||||
|
|
||||||
if(_fileNames.size()==0)
|
if(_fileNames.size()==0)
|
||||||
{
|
{
|
||||||
//QMessageBox::critical(NULL,tr("File error"),tr("File not found or not images in file"));
|
//QMessageBox::critical(NULL,tr("File error"),tr("File not found or not images in file"));
|
||||||
@ -395,8 +388,6 @@ void FileComic::process()
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
int sortedIndex = 0;
|
int sortedIndex = 0;
|
||||||
|
|
||||||
out << "tiempo en ordenar : " << myTimer.elapsed() << endl;
|
|
||||||
|
|
||||||
if(_firstPage == -1)
|
if(_firstPage == -1)
|
||||||
_firstPage = bm->getLastPage();
|
_firstPage = bm->getLastPage();
|
||||||
_index = _firstPage;
|
_index = _firstPage;
|
||||||
@ -410,7 +401,6 @@ void FileComic::process()
|
|||||||
for(int i = 0; i<sectionIndex; i++)
|
for(int i = 0; i<sectionIndex; i++)
|
||||||
archive.getAllData(sections.at(i),this);
|
archive.getAllData(sections.at(i),this);
|
||||||
//archive.getAllData(QVector<quint32>(),this);
|
//archive.getAllData(QVector<quint32>(),this);
|
||||||
out << "tiempo en obtener datos : " << myTimer.elapsed() << endl;
|
|
||||||
/*
|
/*
|
||||||
foreach(QString name,_fileNames)
|
foreach(QString name,_fileNames)
|
||||||
{
|
{
|
||||||
@ -421,8 +411,6 @@ void FileComic::process()
|
|||||||
emit imageLoaded(sortedIndex,_pages[sortedIndex]);
|
emit imageLoaded(sortedIndex,_pages[sortedIndex]);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
out << "--tiempo en copiar datos : " << myTimer.elapsed() << endl;
|
|
||||||
f.close();
|
|
||||||
emit imagesLoaded();
|
emit imagesLoaded();
|
||||||
moveToThread(QApplication::instance()->thread());
|
moveToThread(QApplication::instance()->thread());
|
||||||
}
|
}
|
||||||
|
@ -20,17 +20,12 @@ void YACReaderLocalClient::readMessage()
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
#include <QFile>
|
|
||||||
bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic, QList<ComicDB> & siblings)
|
bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic, QList<ComicDB> & siblings)
|
||||||
{
|
{
|
||||||
localSocket->connectToServer(YACREADERLIBRARY_GUID);
|
localSocket->connectToServer(YACREADERLIBRARY_GUID);
|
||||||
if(localSocket->isOpen())
|
if(localSocket->isOpen())
|
||||||
{
|
{
|
||||||
QFile f("c:/temp/socket.txt");
|
|
||||||
f.open(QIODevice::WriteOnly);
|
|
||||||
QTextStream outt(&f);
|
|
||||||
outt << QString(" antes : %1").arg(comic.id) << endl;
|
|
||||||
|
|
||||||
QByteArray block;
|
QByteArray block;
|
||||||
QDataStream out(&block, QIODevice::WriteOnly);
|
QDataStream out(&block, QIODevice::WriteOnly);
|
||||||
out.setVersion(QDataStream::Qt_4_8);
|
out.setVersion(QDataStream::Qt_4_8);
|
||||||
@ -63,7 +58,6 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic,
|
|||||||
QDataStream dataStream(localSocket->read(totalSize));
|
QDataStream dataStream(localSocket->read(totalSize));
|
||||||
dataStream >> comic;
|
dataStream >> comic;
|
||||||
dataStream >> siblings;
|
dataStream >> siblings;
|
||||||
outt << QString(" despues : %1").arg(comic.id) << endl;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -72,5 +66,27 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic,
|
|||||||
|
|
||||||
bool YACReaderLocalClient::sendComicInfo(quint64 libraryId, ComicDB & comic)
|
bool YACReaderLocalClient::sendComicInfo(quint64 libraryId, ComicDB & comic)
|
||||||
{
|
{
|
||||||
|
localSocket->connectToServer(YACREADERLIBRARY_GUID);
|
||||||
|
if(localSocket->isOpen())
|
||||||
|
{
|
||||||
|
QByteArray block;
|
||||||
|
QDataStream out(&block, QIODevice::WriteOnly);
|
||||||
|
out.setVersion(QDataStream::Qt_4_8);
|
||||||
|
out << (quint16)0;
|
||||||
|
out << (quint8)YACReaderIPCMessages::RequestComicInfo;
|
||||||
|
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);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -23,7 +23,7 @@ bool YACReaderLocalServer::isListening()
|
|||||||
{
|
{
|
||||||
return localServer->isListening();
|
return localServer->isListening();
|
||||||
}
|
}
|
||||||
#include <QFile>
|
|
||||||
void YACReaderLocalServer::sendResponse()
|
void YACReaderLocalServer::sendResponse()
|
||||||
{
|
{
|
||||||
QLocalSocket *clientConnection = localServer->nextPendingConnection();
|
QLocalSocket *clientConnection = localServer->nextPendingConnection();
|
||||||
@ -50,17 +50,10 @@ void YACReaderLocalServer::sendResponse()
|
|||||||
dataStream >> msgType;
|
dataStream >> msgType;
|
||||||
dataStream >> libraryId;
|
dataStream >> libraryId;
|
||||||
dataStream >> comic;
|
dataStream >> comic;
|
||||||
QFile f("c:/temp/socket_server.txt");
|
|
||||||
f.open(QIODevice::WriteOnly);
|
|
||||||
QTextStream outt(&f);
|
|
||||||
outt << QString(" antes : %1 - size : %2").arg(comic.id).arg(totalSize) << endl;
|
|
||||||
|
|
||||||
QList<ComicDB> siblings;
|
QList<ComicDB> siblings;
|
||||||
getComicInfo(libraryId,comic,siblings);
|
getComicInfo(libraryId,comic,siblings);
|
||||||
|
|
||||||
|
|
||||||
outt << QString(" despues : %1 - num sib : %2").arg(comic.id).arg(siblings.count()) << endl;
|
|
||||||
|
|
||||||
QByteArray block;
|
QByteArray block;
|
||||||
QDataStream out(&block, QIODevice::WriteOnly);
|
QDataStream out(&block, QIODevice::WriteOnly);
|
||||||
out.setVersion(QDataStream::Qt_4_8);
|
out.setVersion(QDataStream::Qt_4_8);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user