1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Actually, this is much better solution to previous commit.

This commit is contained in:
David Rosca 2015-01-21 12:32:41 +01:00
parent 7384ed2685
commit b75e8a8451
3 changed files with 3 additions and 18 deletions

View File

@ -205,8 +205,6 @@ LoadRequest LocationBar::createLoadRequest() const
req.setUrl(guessedUrl);
else
req.setUrl(QUrl::fromEncoded(text().toUtf8()));
req.setUrlString(text());
}
return req;

View File

@ -26,17 +26,15 @@ LoadRequest::LoadRequest()
LoadRequest::LoadRequest(const LoadRequest &other)
: m_request(other.m_request)
, m_urlString(other.m_urlString)
, m_operation(other.m_operation)
, m_data(other.m_data)
{
}
LoadRequest::LoadRequest(const QUrl &url, const QString &urlString)
LoadRequest::LoadRequest(const QUrl &url)
: m_operation(GetOperation)
{
setUrl(url);
setUrlString(urlString);
}
LoadRequest::LoadRequest(const QNetworkRequest &req, LoadRequest::Operation op, const QByteArray &data)
@ -49,7 +47,6 @@ LoadRequest::LoadRequest(const QNetworkRequest &req, LoadRequest::Operation op,
LoadRequest &LoadRequest::operator=(const LoadRequest &other)
{
m_request = other.m_request;
m_urlString = other.m_urlString;
m_operation = other.m_operation;
m_data = other.m_data;
return *this;
@ -72,15 +69,7 @@ void LoadRequest::setUrl(const QUrl &url)
QString LoadRequest::urlString() const
{
if (m_urlString.isEmpty())
return m_request.url().toString();
return m_urlString;
}
void LoadRequest::setUrlString(const QString &urlString)
{
m_urlString = urlString;
return QUrl::fromPercentEncoding(m_request.url().toEncoded());
}
QNetworkRequest LoadRequest::networkRequest() const

View File

@ -34,7 +34,7 @@ public:
LoadRequest();
LoadRequest(const LoadRequest &other);
LoadRequest(const QUrl &url, const QString &urlString = QString());
LoadRequest(const QUrl &url);
LoadRequest(const QNetworkRequest &req, Operation op = GetOperation, const QByteArray &data = QByteArray());
LoadRequest &operator=(const LoadRequest &other);
@ -45,7 +45,6 @@ public:
void setUrl(const QUrl &url);
QString urlString() const;
void setUrlString(const QString &urlString);
QNetworkRequest networkRequest() const;
void setNetworkRequest(const QNetworkRequest &req);
@ -58,7 +57,6 @@ public:
private:
QNetworkRequest m_request;
QString m_urlString;
Operation m_operation;
QByteArray m_data;
};