Skip to content
Permalink
Browse files

[auth] Renamed setters to better follow Qt5 conventions

  • Loading branch information
elpaso committed Oct 2, 2017
1 parent 6378042 commit f09e5b16e0cf75c10b3be3496e37ac7156ed1ac4
@@ -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
@@ -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 );
}
@@ -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
@@ -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();
@@ -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
@@ -178,18 +178,18 @@ def test_storeCheckBoxes(self):
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())

0 comments on commit f09e5b1

Please sign in to comment.
You can’t perform that action at this time.