summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qauthenticator.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-07-14 10:58:04 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-07-15 09:50:42 (GMT)
commit69027cdb2ab9b89673edf29d5034bed33e614a05 (patch)
tree773d4c54c391075ec0916c5f995be99dedb6b7b2 /src/network/kernel/qauthenticator.cpp
parent367aa34cbcfa109926087e89d49f9223c1409d44 (diff)
downloadQt-69027cdb2ab9b89673edf29d5034bed33e614a05.zip
Qt-69027cdb2ab9b89673edf29d5034bed33e614a05.tar.gz
Qt-69027cdb2ab9b89673edf29d5034bed33e614a05.tar.bz2
Expose the QAuthenticator map of options in the API.
Task-number: QT-3573 Reviewed-By: Markus Goetz
Diffstat (limited to 'src/network/kernel/qauthenticator.cpp')
-rw-r--r--src/network/kernel/qauthenticator.cpp45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 0ea4fd4..ca8ec1c 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -140,7 +140,8 @@ bool QAuthenticator::operator==(const QAuthenticator &other) const
return d->user == other.d->user
&& d->password == other.d->password
&& d->realm == other.d->realm
- && d->method == other.d->method;
+ && d->method == other.d->method
+ && d->options == other.d->options;
}
/*!
@@ -218,9 +219,49 @@ QString QAuthenticator::realm() const
return d ? d->realm : QString();
}
+/*!
+ \since 4.7
+ Returns the value related to option \a opt if it was set by the server.
+ See \l{QAuthenticator#Options} for more information on incoming options.
+ If option \a opt isn't found, an invalid QVariant will be returned.
+
+ \sa options(), QAuthenticator#Options
+*/
+QVariant QAuthenticator::option(const QString &opt) const
+{
+ return d ? d->options.value(opt) : QVariant();
+}
+
+/*!
+ \since 4.7
+ Returns all incoming options set in this QAuthenticator object by parsing
+ the server reply. See \l{QAuthenticator#Options} for more information
+ on incoming options.
+
+ \sa option(), QAuthenticator#Options
+*/
+QVariantHash QAuthenticator::options() const
+{
+ return d ? d->options : QVariantHash();
+}
+
+/*!
+ \since 4.7
+
+ Sets the outgoing option \a opt to value \a value.
+ See \l{QAuthenticator#Options} for more information on outgoing options.
+
+ \sa options(), option(), QAuthenticator#Options
+*/
+void QAuthenticator::setOption(const QString &opt, const QVariant &value)
+{
+ detach();
+ d->options.insert(opt, value);
+}
+
/*!
- returns true if the authenticator is null.
+ Returns true if the authenticator is null.
*/
bool QAuthenticator::isNull() const
{