Use local variable instead of function parameter #5020
This commit is contained in:
parent
da315ec164
commit
98385c06e9
|
@ -34,8 +34,7 @@ int WebClient::getEdition(
|
||||||
QString responseJson;
|
QString responseJson;
|
||||||
int edition = Unknown;
|
int edition = Unknown;
|
||||||
try {
|
try {
|
||||||
QStringList args("--login-auth");
|
responseJson = request(email, password);
|
||||||
responseJson = request(email, password, args);
|
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
|
@ -91,9 +90,9 @@ int WebClient::getEdition(
|
||||||
|
|
||||||
QString WebClient::request(
|
QString WebClient::request(
|
||||||
const QString& email,
|
const QString& email,
|
||||||
const QString& password,
|
const QString& password)
|
||||||
QStringList& args)
|
|
||||||
{
|
{
|
||||||
|
QStringList args("--login-auth");
|
||||||
// hash password in case it contains interesting chars.
|
// hash password in case it contains interesting chars.
|
||||||
QString credentials(email + ":" + hash(password) + "\n");
|
QString credentials(email + ":" + hash(password) + "\n");
|
||||||
return m_CoreInterface.run(args, credentials);
|
return m_CoreInterface.run(args, credentials);
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#define WEBCLIENT_H
|
#define WEBCLIENT_H
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "CoreInterface.h"
|
#include "CoreInterface.h"
|
||||||
|
@ -45,8 +44,7 @@ signals:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString request(const QString& email,
|
QString request(const QString& email,
|
||||||
const QString& password,
|
const QString& password);
|
||||||
QStringList& args);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_Email;
|
QString m_Email;
|
||||||
|
|
Loading…
Reference in New Issue