Skip to content

Commit 7678be1

Browse files
committed
Dox++
(cherry picked from commit eba5409)
1 parent 41e7d07 commit 7678be1

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

python/core/auto_generated/qgscredentials.sip.in

+27
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,34 @@ signal destroyed() to be notified of the deletion
3232
virtual ~QgsCredentials();
3333

3434
bool get( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
35+
%Docstring
36+
Requests credentials for the specified ``realm``.
37+
38+
If existing credentials exist for the given ``realm``, these will be returned. Otherwise the credential
39+
handler will prompt for the correct username and password.
40+
41+
The retrieved or user-entered details will be stored in ``username`` and ``password``.
42+
43+
Optionally, a specific ``message`` can be used to advise users of the context for the credentials request.
44+
45+
.. note::
46+
47+
This method will not automatically store the newly obtained credentials. Callers must
48+
manually call put() after verifying that the obtained credentials are correct.
49+
50+
.. seealso:: :py:func:`put`
51+
%End
52+
3553
void put( const QString &realm, const QString &username, const QString &password );
54+
%Docstring
55+
Stores the correct ``username`` and ``password`` for the specified ``realm``.
56+
57+
These values will be used for all future calls to get() for the same ``realm``, without requesting
58+
users to re-enter them. It is the caller's responsibility to ensure that only valid ``username`` and ``password``
59+
combinations are used with this method.
60+
61+
.. seealso:: :py:func:`get`
62+
%End
3663

3764
bool getMasterPassword( QString &password /In,Out/, bool stored = false );
3865

src/core/qgscredentials.h

+25
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,32 @@ class CORE_EXPORT QgsCredentials
4747
*/
4848
virtual ~QgsCredentials() = default;
4949

50+
/**
51+
* Requests credentials for the specified \a realm.
52+
*
53+
* If existing credentials exist for the given \a realm, these will be returned. Otherwise the credential
54+
* handler will prompt for the correct username and password.
55+
*
56+
* The retrieved or user-entered details will be stored in \a username and \a password.
57+
*
58+
* Optionally, a specific \a message can be used to advise users of the context for the credentials request.
59+
*
60+
* \note This method will not automatically store the newly obtained credentials. Callers must
61+
* manually call put() after verifying that the obtained credentials are correct.
62+
*
63+
* \see put()
64+
*/
5065
bool get( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() );
66+
67+
/**
68+
* Stores the correct \a username and \a password for the specified \a realm.
69+
*
70+
* These values will be used for all future calls to get() for the same \a realm, without requesting
71+
* users to re-enter them. It is the caller's responsibility to ensure that only valid \a username and \a password
72+
* combinations are used with this method.
73+
*
74+
* \see get()
75+
*/
5176
void put( const QString &realm, const QString &username, const QString &password );
5277

5378
bool getMasterPassword( QString &password SIP_INOUT, bool stored = false );

0 commit comments

Comments
 (0)