v0.1
This commit is contained in:
parent
8d99b55818
commit
7e37546ae9
108 changed files with 6063 additions and 1450 deletions
|
@ -3,7 +3,10 @@
|
|||
#include <QHttpPart>
|
||||
#include <QTextCodec>
|
||||
#include <QUrlQuery>
|
||||
|
||||
#include <QNetworkCookieJar>
|
||||
#include <QNetworkCookie>
|
||||
#include <QList>
|
||||
#include <QDataStream>
|
||||
#include "uploadableimage.h"
|
||||
|
||||
XHR *XHR::instance()
|
||||
|
@ -114,7 +117,8 @@ void XHR::get()
|
|||
QByteArray loginData = m_login.toLocal8Bit().toBase64();
|
||||
QString headerData = "Basic " + loginData;
|
||||
request.setRawHeader("Authorization", headerData.toLocal8Bit());
|
||||
|
||||
// QNetworkCookieJar* cJar = new QNetworkCookieJar;
|
||||
// manager.setCookieJar(cJar);
|
||||
|
||||
request.setUrl(requrl);
|
||||
reply = manager.get(request);
|
||||
|
@ -184,7 +188,7 @@ void XHR::onReplySuccess()
|
|||
qDebug() << "!";
|
||||
emit this->success( bufferToString() );
|
||||
buffer.clear();
|
||||
reply->deleteLater();
|
||||
// reply->deleteLater();
|
||||
}
|
||||
|
||||
void XHR::onRequestFinished()
|
||||
|
@ -206,6 +210,15 @@ void XHR::onReadyRead()
|
|||
{
|
||||
qDebug() << ".";
|
||||
buffer += reply->readAll();
|
||||
// QList<QNetworkCookie> list = manager.cookieJar()->cookiesForUrl(m_url);
|
||||
// QFile f("/home/pankraz/cookie.txt");
|
||||
// f.open(QIODevice::ReadWrite);
|
||||
// for(int i = 0; i < list.size(); ++i){
|
||||
// QDataStream s(&f);
|
||||
// s << list.at(i).toRawForm();
|
||||
// }
|
||||
// f.close();
|
||||
|
||||
}
|
||||
|
||||
//void XHR::updateDownloadProgress(qint64 bytesRead, qint64 totalBytes)
|
||||
|
@ -227,5 +240,3 @@ QString XHR::bufferToString()
|
|||
{
|
||||
return QTextCodec::codecForName("utf-8")->toUnicode(buffer);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue