Skip to content

Commit 56bd682

Browse files
committedDec 14, 2018
Avoid duplicate changed signals thrown by QgsAuthConfigSelect
1 parent 11ea28a commit 56bd682

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎src/gui/auth/qgsauthconfigselect.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ void QgsAuthConfigSelect::setConfigId( const QString &authcfg )
8383
{
8484
mAuthCfg = authcfg;
8585
}
86+
// avoid duplicate call to loadConfig(), which may potentially be triggered by combo box index changes in the
87+
// call to populateConfigSelector(). We *always* call loadConfig() after this, so we don't want to do it twice.
88+
mTemporarilyBlockLoad = true;
8689
populateConfigSelector();
90+
mTemporarilyBlockLoad = false;
8791
loadConfig();
8892
}
8993
}
@@ -197,7 +201,8 @@ void QgsAuthConfigSelect::cmbConfigSelect_currentIndexChanged( int index )
197201
{
198202
QString authcfg = cmbConfigSelect->itemData( index ).toString();
199203
mAuthCfg = ( !authcfg.isEmpty() && authcfg != QLatin1String( "0" ) ) ? authcfg : QString();
200-
loadConfig();
204+
if ( !mTemporarilyBlockLoad )
205+
loadConfig();
201206
}
202207

203208
void QgsAuthConfigSelect::btnConfigAdd_clicked()

‎src/gui/auth/qgsauthconfigselect.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class GUI_EXPORT QgsAuthConfigSelect : public QWidget, private Ui::QgsAuthConfig
9393
bool mDisabled = false;
9494
QVBoxLayout *mAuthNotifyLayout = nullptr;
9595
QLabel *mAuthNotify = nullptr;
96+
bool mTemporarilyBlockLoad = false;
9697
};
9798

9899

0 commit comments

Comments
 (0)
Please sign in to comment.