Merge with feature-crashreport
This commit is contained in:
parent
10ae0d201c
commit
b63f917cde
1 changed files with 15 additions and 2 deletions
|
@ -21,6 +21,9 @@
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||||
|
# include <QUrlQuery>
|
||||||
|
#endif
|
||||||
|
|
||||||
class CCrashReportSocketPvt
|
class CCrashReportSocketPvt
|
||||||
{
|
{
|
||||||
|
@ -43,16 +46,26 @@ CCrashReportSocket::~CCrashReportSocket()
|
||||||
|
|
||||||
void CCrashReportSocket::sendReport( const SCrashReportData &data )
|
void CCrashReportSocket::sendReport( const SCrashReportData &data )
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||||
|
QUrlQuery params;
|
||||||
|
#else
|
||||||
QUrl params;
|
QUrl params;
|
||||||
|
#endif
|
||||||
params.addQueryItem( "report", data.report );
|
params.addQueryItem( "report", data.report );
|
||||||
params.addQueryItem( "descr", data.description );
|
params.addQueryItem( "descr", data.description );
|
||||||
params.addQueryItem( "email", data.email );
|
params.addQueryItem("email", data.email);
|
||||||
|
|
||||||
QUrl url( m_url );
|
QUrl url( m_url );
|
||||||
QNetworkRequest request( url );
|
QNetworkRequest request( url );
|
||||||
request.setRawHeader( "Connection", "close" );
|
request.setRawHeader( "Connection", "close" );
|
||||||
|
|
||||||
m_pvt->mgr.post( request, params.encodedQuery() );
|
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||||
|
QByteArray postData = params.query(QUrl::FullyEncoded).toUtf8();
|
||||||
|
#else
|
||||||
|
QByteArray postData = params.encodedQuery();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_pvt->mgr.post(request, postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCrashReportSocket::onFinished( QNetworkReply *reply )
|
void CCrashReportSocket::onFinished( QNetworkReply *reply )
|
||||||
|
|
Loading…
Reference in a new issue