mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 06:24:39 -04:00
fixed issues in comic vine dialog
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
#define PREVIOUS_VERSION "6.0.0"
|
||||
|
||||
HttpWorker::HttpWorker(const QString & urlString)
|
||||
:QThread(),url(urlString)
|
||||
:QThread(),url(urlString),_error(false),_timeout(false)
|
||||
{
|
||||
|
||||
}
|
||||
@ -28,6 +28,16 @@ QByteArray HttpWorker::getResult()
|
||||
return result;
|
||||
}
|
||||
|
||||
bool HttpWorker::wasValid()
|
||||
{
|
||||
return !_error;
|
||||
}
|
||||
|
||||
bool HttpWorker::wasTimeout()
|
||||
{
|
||||
return _timeout;
|
||||
}
|
||||
|
||||
void HttpWorker::run()
|
||||
{
|
||||
QNetworkAccessManager manager;
|
||||
@ -44,10 +54,12 @@ void HttpWorker::run()
|
||||
|
||||
if(tT.isActive()){
|
||||
// download complete
|
||||
_error = !(reply->error() == QNetworkReply::NoError);
|
||||
result = reply->readAll();
|
||||
emit dataReady(result);
|
||||
tT.stop();
|
||||
} else {
|
||||
_timeout = true;
|
||||
emit timeout();
|
||||
}
|
||||
}
|
||||
|
@ -15,11 +15,15 @@
|
||||
public slots:
|
||||
void get();
|
||||
QByteArray getResult();
|
||||
bool wasValid();
|
||||
bool wasTimeout();
|
||||
private:
|
||||
void run();
|
||||
QUrl url;
|
||||
int httpGetId;
|
||||
QByteArray result;
|
||||
bool _error;
|
||||
bool _timeout;
|
||||
signals:
|
||||
void dataReady(const QByteArray &);
|
||||
void timeout();
|
||||
|
Reference in New Issue
Block a user