Qt5 compile fix for crash report tool

This commit is contained in:
kaetemi 2015-02-24 17:18:48 +01:00
parent 83f11f3522
commit 816d9a47e8

View file

@ -21,6 +21,9 @@
#include <QUrl>
#include <QNetworkRequest>
#include <QNetworkReply>
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
# include <QUrlQuery>
#endif
class CCrashReportSocketPvt
{
@ -43,7 +46,11 @@ CCrashReportSocket::~CCrashReportSocket()
void CCrashReportSocket::sendReport( const SCrashReportData &data )
{
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
QUrlQuery params;
#else
QUrl params;
#endif
params.addQueryItem( "report", data.report );
params.addQueryItem( "descr", data.description );
params.addQueryItem("email", data.email);
@ -52,7 +59,13 @@ void CCrashReportSocket::sendReport( const SCrashReportData &data )
QNetworkRequest request( url );
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 )