summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl.h
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-05-07 01:00:16 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-13 11:06:18 +0200
commit5ab700f63993d616c37e0470c4aaeb80e7472cd9 (patch)
tree862bdbbdaa280d16d36f6cbf6f144a6b8acec285 /src/corelib/io/qurl.h
parentb587da56b945e6e3ddb4cfc16d6df3bc0363f728 (diff)
Restore QUrl::setEncodedQuery(QByteArray()) to the Qt4 behavior.
Null bytearray means no query, and QString::fromLatin1(QByteArray()) doesn't give a null string, but an empty string. Same for setEncodedFragment(QByteArray()). Change-Id: I992e9253e35941d66886456872ea06aa2ae92450 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qurl.h')
-rw-r--r--src/corelib/io/qurl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 7c6e47c73f..79968e5587 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -294,12 +294,12 @@ public:
QT_DEPRECATED QByteArray encodedQuery() const
{ return toLatin1_helper(query(FullyEncoded)); }
QT_DEPRECATED void setEncodedQuery(const QByteArray &value)
- { setQuery(QString::fromLatin1(value)); }
+ { setQuery(value.isNull() ? QString() : QString::fromLatin1(value)); }
QT_DEPRECATED QByteArray encodedFragment() const
{ return toLatin1_helper(fragment(FullyEncoded)); }
QT_DEPRECATED void setEncodedFragment(const QByteArray &value)
- { setFragment(QString::fromLatin1(value)); }
+ { setFragment(value.isNull() ? QString() : QString::fromLatin1(value)); }
private:
// helper function for the encodedQuery and encodedFragment functions