Skip to content

Commit

Permalink
[auth] Renamed setters to better follow Qt5 conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Oct 2, 2017
1 parent 6378042 commit f09e5b1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
8 changes: 4 additions & 4 deletions python/gui/auth/qgsauthsettingswidget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/gui/auth/qgsauthsettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
8 changes: 4 additions & 4 deletions src/gui/auth/qgsauthsettingswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/providers/db2/qgsdb2newconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion src/providers/db2/qgsdb2newconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/src/python/test_authsettingswidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit f09e5b1

Please sign in to comment.