Skip to content

Commit

Permalink
Avoid duplicate changed signals thrown by QgsAuthConfigSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 14, 2018
1 parent 11ea28a commit 56bd682
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui/auth/qgsauthconfigselect.cpp
Expand Up @@ -83,7 +83,11 @@ void QgsAuthConfigSelect::setConfigId( const QString &authcfg )
{
mAuthCfg = authcfg;
}
// avoid duplicate call to loadConfig(), which may potentially be triggered by combo box index changes in the
// call to populateConfigSelector(). We *always* call loadConfig() after this, so we don't want to do it twice.
mTemporarilyBlockLoad = true;
populateConfigSelector();
mTemporarilyBlockLoad = false;
loadConfig();
}
}
Expand Down Expand Up @@ -197,7 +201,8 @@ void QgsAuthConfigSelect::cmbConfigSelect_currentIndexChanged( int index )
{
QString authcfg = cmbConfigSelect->itemData( index ).toString();
mAuthCfg = ( !authcfg.isEmpty() && authcfg != QLatin1String( "0" ) ) ? authcfg : QString();
loadConfig();
if ( !mTemporarilyBlockLoad )
loadConfig();
}

void QgsAuthConfigSelect::btnConfigAdd_clicked()
Expand Down
1 change: 1 addition & 0 deletions src/gui/auth/qgsauthconfigselect.h
Expand Up @@ -93,6 +93,7 @@ class GUI_EXPORT QgsAuthConfigSelect : public QWidget, private Ui::QgsAuthConfig
bool mDisabled = false;
QVBoxLayout *mAuthNotifyLayout = nullptr;
QLabel *mAuthNotify = nullptr;
bool mTemporarilyBlockLoad = false;
};


Expand Down

0 comments on commit 56bd682

Please sign in to comment.