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)
committerJason McDonald <jason.mcdonald@nokia.com>2010-07-16 06:57:22 (GMT)
commit977daf857c7e690c6c8b11e9e72e84963a004e66 (patch)
tree6121c2b9909bab97a58b56b2aae90996ffe0fa5f /src/network/kernel/qauthenticator.cpp
parentbf11d9223cc6948ed88848b5a51585df1a22d236 (diff)
downloadQt-977daf857c7e690c6c8b11e9e72e84963a004e66.zip
Qt-977daf857c7e690c6c8b11e9e72e84963a004e66.tar.gz
Qt-977daf857c7e690c6c8b11e9e72e84963a004e66.tar.bz2
Expose the QAuthenticator map of options in the API.
Task-number: QT-3573 Reviewed-By: Markus Goetz (cherry picked from commit 69027cdb2ab9b89673edf29d5034bed33e614a05)
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
{