fix: this may fixed #457

This commit is contained in:
Qv2ray-dev 2020-03-26 16:04:59 +08:00
parent c4bfb4222c
commit a17d6f2802
3 changed files with 11 additions and 2 deletions

View File

@ -1 +1 @@
4957
4960

View File

@ -350,7 +350,7 @@ namespace Qv2ray::base::objects
QString user;
QString pass;
int level;
UserObject() : user("username"), pass("password"), level(0)
UserObject() : user(), pass(), level(0)
{
}
XTOSTRUCT(O(user, pass, level))

View File

@ -124,6 +124,11 @@ OUTBOUND OutboundEditor::GenerateConnectionJson()
}
else if (OutboundType == "socks")
{
if (socks.users.first().user.isEmpty() && socks.users.first().pass.isEmpty())
{
LOG(MODULE_UI, "Removed empty user form SOCKS settings")
socks.users.clear();
}
streaming = QJsonObject();
LOG(MODULE_CONNECTION, "Socks outbound does not need StreamSettings.")
QJsonArray servers;
@ -276,10 +281,14 @@ void OutboundEditor::on_ss_otaCheckBox_stateChanged(int arg1)
void OutboundEditor::on_socks_UserNameTxt_textEdited(const QString &arg1)
{
if (socks.users.isEmpty())
socks.users.push_back(SocksServerObject::UserObject());
socks.users.front().user = arg1;
}
void OutboundEditor::on_socks_PasswordTxt_textEdited(const QString &arg1)
{
if (socks.users.isEmpty())
socks.users.push_back(SocksServerObject::UserObject());
socks.users.front().pass = arg1;
}