mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
fixed YACReaderLocalClient in Qt >= 5
This commit is contained in:
parent
759bd048fc
commit
4c31cd661b
@ -25,6 +25,7 @@ void YACReaderLocalClient::readMessage()
|
||||
{
|
||||
|
||||
}
|
||||
#include <QMessageBox>
|
||||
|
||||
bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic, QList<ComicDB> & siblings)
|
||||
{
|
||||
@ -72,9 +73,13 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic,
|
||||
quint16 totalSize = 0;
|
||||
sizeStream >> totalSize;
|
||||
|
||||
QByteArray data;
|
||||
|
||||
tries = 0;
|
||||
while(localSocket->bytesAvailable() < totalSize && tries < 10 )
|
||||
while(data.length() < totalSize && tries < 10 )
|
||||
{
|
||||
data.append(localSocket->readAll());
|
||||
if(data.length() < totalSize)
|
||||
localSocket->waitForReadyRead(100);
|
||||
tries++;
|
||||
}
|
||||
@ -83,7 +88,8 @@ bool YACReaderLocalClient::requestComicInfo(quint64 libraryId, ComicDB & comic,
|
||||
localSocket->close();
|
||||
return false;
|
||||
}
|
||||
QDataStream dataStream(localSocket->read(totalSize));
|
||||
|
||||
QDataStream dataStream(data);
|
||||
dataStream >> comic;
|
||||
dataStream >> siblings;
|
||||
localSocket->close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user