[auth] Renamed setters to better follow Qt5 conventions

This commit is contained in:
Alessandro Pasotti 2017-10-02 17:12:02 +02:00
parent 6378042bd1
commit f09e5b16e0
6 changed files with 16 additions and 17 deletions

View File

@ -117,16 +117,16 @@ class QgsAuthSettingsWidget : QWidget
\param enabled
%End
void setStoreUsername( bool checked );
void setStoreUsernameChecked( bool checked );
%Docstring
setStoreUsername check the "Store" checkbox for the username
setStoreUsernameChecked check the "Store" checkbox for the username
\param checked
.. seealso:: showStoreCheckboxes
%End
void setStorePassword( bool checked );
void setStorePasswordChecked( bool checked );
%Docstring
updateStorePasswordcheck the "Store" checkbox for the password
setStorePasswordCheched check the "Store" checkbox for the password
\param checked
.. seealso:: showStoreCheckboxes
%End

View File

@ -120,12 +120,12 @@ void QgsAuthSettingsWidget::showStoreCheckboxes( bool enabled )
}
}
void QgsAuthSettingsWidget::setStoreUsername( bool checked )
void QgsAuthSettingsWidget::setStoreUsernameChecked( bool checked )
{
cbStoreUsername->setChecked( checked );
}
void QgsAuthSettingsWidget::setStorePassword( bool checked )
void QgsAuthSettingsWidget::setStorePasswordChecked( bool checked )
{
cbStorePassword->setChecked( checked );
}

View File

@ -126,18 +126,18 @@ class GUI_EXPORT QgsAuthSettingsWidget : public QWidget, private Ui::QgsAuthSett
void showStoreCheckboxes( bool enabled );
/**
* \brief setStoreUsername check the "Store" checkbox for the username
* \brief setStoreUsernameChecked check the "Store" checkbox for the username
* \param checked
* \see showStoreCheckboxes
*/
void setStoreUsername( bool checked );
void setStoreUsernameChecked( bool checked );
/**
* \brief updateStorePasswordcheck the "Store" checkbox for the password
* \brief setStorePasswordCheched check the "Store" checkbox for the password
* \param checked
* \see showStoreCheckboxes
*/
void setStorePassword( bool checked );
void setStorePasswordChecked( bool checked );
/**
* \brief storePassword

View File

@ -53,13 +53,13 @@ QgsDb2NewConnection::QgsDb2NewConnection( QWidget *parent, const QString &connNa
if ( settings.value( key + "/saveUsername" ).toString() == QLatin1String( "true" ) )
{
mAuthSettings->setUsername( settings.value( key + "/username" ).toString() );
mAuthSettings->setStoreUsername( true );
mAuthSettings->setStoreUsernameChecked( true );
}
if ( settings.value( key + "/savePassword" ).toString() == QLatin1String( "true" ) )
{
mAuthSettings->setPassword( settings.value( key + "/password" ).toString() );
mAuthSettings->setStorePassword( true );
mAuthSettings->setStorePasswordChecked( true );
}
QString authcfg = settings.value( key + "/authcfg" ).toString();

View File

@ -20,7 +20,6 @@
#include "ui_qgsdb2newconnectionbase.h"
#include "qgsguiutils.h"
#include "qgshelp.h"
#include "qgsauthconfigselect.h"
/** \class QgsDb2NewConnection
* \brief Dialog to allow the user to configure and save connection

View File

@ -178,18 +178,18 @@ class TestAuthenticationWidget(unittest.TestCase):
self.assertFalse(w.storeUsernameIsChecked())
w = QgsAuthSettingsWidget()
w.setStorePassword(True)
w.setStorePasswordChecked(True)
self.assertTrue(w.storePasswordIsChecked())
self.assertFalse(w.storeUsernameIsChecked())
w = QgsAuthSettingsWidget()
w.setStoreUsername(True)
w.setStoreUsernameChecked(True)
self.assertFalse(w.storePasswordIsChecked())
self.assertTrue(w.storeUsernameIsChecked())
w = QgsAuthSettingsWidget()
w.setStoreUsername(True)
w.setStorePassword(True)
w.setStoreUsernameChecked(True)
w.setStorePasswordChecked(True)
self.assertTrue(w.storePasswordIsChecked())
self.assertTrue(w.storeUsernameIsChecked())