11 #include "wlquery.hpp"
12 using namespace Huggle;
28 this->StartTime = QDateTime::currentDateTime();
29 this->Status = StatusProcessing;
36 QString whitelist =
"";
47 if (whitelist.endsWith(
"|"))
49 whitelist = whitelist.mid(0, whitelist.length() - 1);
51 whitelist +=
"||EOW||";
52 params =
"wl=" + QUrl::toPercentEncoding(whitelist);
54 QNetworkRequest request(url);
57 this->r = Query::NetworkManager.get(request);
60 request.setHeader(QNetworkRequest::ContentTypeHeader,
"application/x-www-form-urlencoded");
61 this->r = Query::NetworkManager.post(request, params.toUtf8());
63 QObject::connect(this->r, SIGNAL(finished()),
this, SLOT(Finished()));
64 QObject::connect(this->r, SIGNAL(readyRead()),
this, SLOT(ReadData()));
67 void WLQuery::ReadData()
69 this->
Result->
Data += QString(this->r->readAll());
72 void WLQuery::Finished()
74 this->
Result->
Data += QString(this->r->readAll());
79 this->
Result->Failed =
true;
80 this->r->deleteLater();
84 this->r->deleteLater();
86 this->Status = StatusDone;
void Process()
Execute query.
static QStringList WhiteList
Data of wl.
static WikiSite Project
currently selected project
QString ErrorMessage
If query is in error the reason for error is stored here.
QString Data
Data retrieved by query.
QueryResult * Result
Result of query, see documentation of QueryResult for more.