diff --git a/YACReader/comic.cpp b/YACReader/comic.cpp index 030d3e7e..376729cb 100644 --- a/YACReader/comic.cpp +++ b/YACReader/comic.cpp @@ -357,22 +357,15 @@ QList > FileComic::getSections(int & sectionIndex) void FileComic::process() { - QFile f("c:/temp/out.txt"); - f.open(QIODevice::WriteOnly); - QTextStream out(&f); - QTime myTimer; myTimer.start(); // do something.. CompressedArchive archive(_path); - out << "tiempo en abrir : " << myTimer.elapsed() << endl; //se filtran para obtener sólo los formatos soportados _order = archive.getFileNames(); _fileNames = filter(_order); - out << "tiempo en filtrar : " << myTimer.elapsed() << endl; - if(_fileNames.size()==0) { //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 sortedIndex = 0; - out << "tiempo en ordenar : " << myTimer.elapsed() << endl; - if(_firstPage == -1) _firstPage = bm->getLastPage(); _index = _firstPage; @@ -410,7 +401,6 @@ void FileComic::process() for(int i = 0; i(),this); - out << "tiempo en obtener datos : " << myTimer.elapsed() << endl; /* foreach(QString name,_fileNames) { @@ -421,8 +411,6 @@ void FileComic::process() emit imageLoaded(sortedIndex,_pages[sortedIndex]); }*/ - out << "--tiempo en copiar datos : " << myTimer.elapsed() << endl; - f.close(); emit imagesLoaded(); moveToThread(QApplication::instance()->thread()); } diff --git a/YACReader/yacreader_local_client.cpp b/YACReader/yacreader_local_client.cpp index 4ced2baf..2b2f1876 100644 --- a/YACReader/yacreader_local_client.cpp +++ b/YACReader/yacreader_local_client.cpp @@ -20,17 +20,12 @@ void YACReaderLocalClient::readMessage() { } -#include + bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic, QList & siblings) { localSocket->connectToServer(YACREADERLIBRARY_GUID); 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; QDataStream out(&block, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_8); @@ -63,7 +58,6 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic, QDataStream dataStream(localSocket->read(totalSize)); dataStream >> comic; dataStream >> siblings; - outt << QString(" despues : %1").arg(comic.id) << endl; return true; } else @@ -72,5 +66,27 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic, bool YACReaderLocalClient::sendComicInfo(quint64 libraryId, ComicDB & comic) { - return true; + 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; + } + else + return false; + } diff --git a/YACReaderLibrary/yacreader_local_server.cpp b/YACReaderLibrary/yacreader_local_server.cpp index 41106536..f9d05abf 100644 --- a/YACReaderLibrary/yacreader_local_server.cpp +++ b/YACReaderLibrary/yacreader_local_server.cpp @@ -23,7 +23,7 @@ bool YACReaderLocalServer::isListening() { return localServer->isListening(); } -#include + void YACReaderLocalServer::sendResponse() { QLocalSocket *clientConnection = localServer->nextPendingConnection(); @@ -50,17 +50,10 @@ void YACReaderLocalServer::sendResponse() dataStream >> msgType; dataStream >> libraryId; 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 siblings; getComicInfo(libraryId,comic,siblings); - - outt << QString(" despues : %1 - num sib : %2").arg(comic.id).arg(siblings.count()) << endl; - QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_8);