Improve code

This commit is contained in:
Kevin Yue
2020-05-23 21:33:52 +08:00
parent 7f5bf0ce52
commit e22bb8e1b7
14 changed files with 61 additions and 51 deletions

View File

@@ -33,14 +33,15 @@ SAMLLoginWindow* gpclient::helper::samlLogin(QString samlMethod, QString samlReq
PLOGE << "Unknown saml-auth-method expected POST or REDIRECT, got " << samlMethod;
return nullptr;
}
return loginWindow;
}
GPGateway &gpclient::helper::filterPreferredGateway(QList<GPGateway> &gateways, QString ruleName)
GPGateway gpclient::helper::filterPreferredGateway(QList<GPGateway> *gateways, const QString ruleName)
{
GPGateway& gateway = gateways.first();
GPGateway gateway = gateways->first();
for (GPGateway& g : gateways) {
for (GPGateway g : *gateways) {
if (g.priorityOf(ruleName) > gateway.priorityOf(ruleName)) {
gateway = g;
}