Drop Qt 4 support

This commit is contained in:
Eugene Shalygin 2017-01-19 13:10:09 +01:00
parent 60998a68eb
commit e64bb1de8c
67 changed files with 48 additions and 8809 deletions

View file

@ -31,9 +31,7 @@
#include <QStringList>
#include <QUrl>
#ifdef QBT_USES_QT5
#include <QUrlQuery>
#endif
#include <QDir>
#include <QDebug>
#include "requestparser.h"
@ -121,11 +119,7 @@ bool RequestParser::parseStartingLine(const QString &line)
m_request.path = url.path(); // Path
// Parse GET parameters
#ifndef QBT_USES_QT5
QListIterator<QPair<QString, QString> > i(url.queryItems());
#else
QListIterator<QPair<QString, QString> > i(QUrlQuery(url).queryItems());
#endif
while (i.hasNext()) {
QPair<QString, QString> pair = i.next();
m_request.gets[pair.first] = pair.second;
@ -220,13 +214,8 @@ bool RequestParser::parseContent(const QByteArray& data)
// Parse url-encoded POST data
if (m_request.headers["content-type"].startsWith("application/x-www-form-urlencoded")) {
QUrl url;
#ifndef QBT_USES_QT5
url.setEncodedQuery(data);
QListIterator<QPair<QString, QString> > i(url.queryItems());
#else
url.setQuery(data);
QListIterator<QPair<QString, QString> > i(QUrlQuery(url).queryItems(QUrl::FullyDecoded));
#endif
while (i.hasNext()) {
QPair<QString, QString> pair = i.next();
m_request.posts[pair.first.toLower()] = pair.second;