mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 02:40:20 +08:00
fix: fixed #257 prevent using manual function Stringify
This commit is contained in:
parent
69a9c23100
commit
e5d87ed052
@ -1 +1 @@
|
||||
2866
|
||||
2871
|
||||
|
@ -37,7 +37,7 @@ namespace Qv2ray
|
||||
vmessUriRoot["host"] = realHost;
|
||||
vmessUriRoot["path"] = transfer.wsSettings.path;
|
||||
} else if (transfer.network == "h2" || transfer.network == "http") {
|
||||
vmessUriRoot["host"] = Stringify(transfer.httpSettings.host, ",");
|
||||
vmessUriRoot["host"] = transfer.httpSettings.host.join(",");
|
||||
vmessUriRoot["path"] = transfer.httpSettings.path;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ namespace Qv2ray
|
||||
} else{\
|
||||
*errMessage = QObject::tr(#key " does not exist."); \
|
||||
LOG(MODULE_IMPORT, "Cannot process \"" #key "\" since it's not included in the json object." ) \
|
||||
LOG(MODULE_IMPORT, " --> values: " + Stringify(val) ) \
|
||||
LOG(MODULE_IMPORT, " --> values: " + val.join(";")) \
|
||||
LOG(MODULE_IMPORT, " --> PS: " + ps) \
|
||||
}\
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ namespace Qv2ray
|
||||
}
|
||||
|
||||
QString output = QString(proc.readAllStandardOutput());
|
||||
LOG(MODULE_VCORE, "V2ray output: " + Stringify(SplitLines(output)))
|
||||
LOG(MODULE_VCORE, "V2ray output: " + SplitLines(output).join(";"))
|
||||
*message = SplitLines(output).first();
|
||||
return true;
|
||||
}
|
||||
@ -144,7 +144,7 @@ namespace Qv2ray
|
||||
inboundTags.append(tag);
|
||||
}
|
||||
|
||||
DEBUG(MODULE_VCORE, "Found Inbound Tags: " + Stringify(inboundTags))
|
||||
DEBUG(MODULE_VCORE, "Found Inbound Tags: " + inboundTags.join(";"))
|
||||
QString json = JsonToString(root);
|
||||
// Write the final configuration to the disk.
|
||||
StringToFile(&json, new QFile(QV2RAY_GENERATED_FILE_PATH));
|
||||
|
@ -164,7 +164,7 @@ bool initialiseQv2ray()
|
||||
// Even the last folder failed to pass the check.
|
||||
LOG(MODULE_INIT, "FATAL")
|
||||
LOG(MODULE_INIT, " ---> CANNOT find a proper place to store Qv2ray config files.")
|
||||
QString searchPath = Stringify(configFilePaths, NEWLINE);
|
||||
QString searchPath = configFilePaths.join(NEWLINE);
|
||||
QvMessageBoxWarn(nullptr, QObject::tr("Cannot Start Qv2ray"),
|
||||
QObject::tr("Cannot find a place to store config files.") + NEWLINE +
|
||||
QObject::tr("Qv2ray has searched these paths below:") +
|
||||
|
@ -241,7 +241,7 @@ void MainWindow::CheckSubscriptionsUpdate()
|
||||
if (!updateList.isEmpty()) {
|
||||
QvMessageBoxWarn(this, tr("Update Subscriptions"),
|
||||
tr("There are subscriptions need to be updated, please go to subscriptions window to update them.") + NEWLINE + NEWLINE +
|
||||
tr("These subscriptions are out-of-date: ") + NEWLINE + Stringify(updateList));
|
||||
tr("These subscriptions are out-of-date: ") + NEWLINE + updateList.join(";"));
|
||||
on_subsButton_clicked();
|
||||
}
|
||||
}
|
||||
|
@ -373,19 +373,19 @@ void RouteEditor::ShowCurrentRuleDetail()
|
||||
routePortTxt->setText(CurrentRule.port);
|
||||
//
|
||||
// Users
|
||||
QString users = Stringify(CurrentRule.user, NEWLINE);
|
||||
QString users = CurrentRule.user.join(NEWLINE);
|
||||
routeUserTxt->setPlainText(users);
|
||||
//
|
||||
// Incoming Sources
|
||||
QString sources = Stringify(CurrentRule.source, NEWLINE);
|
||||
QString sources = CurrentRule.source.join(NEWLINE);
|
||||
sourceIPList->setPlainText(sources);
|
||||
//
|
||||
// Domains
|
||||
QString domains = Stringify(CurrentRule.domain, NEWLINE);
|
||||
QString domains = CurrentRule.domain.join(NEWLINE);
|
||||
hostList->setPlainText(domains);
|
||||
//
|
||||
// Outcoming IPs
|
||||
QString ips = Stringify(CurrentRule.ip, NEWLINE);
|
||||
QString ips = CurrentRule.ip.join(NEWLINE);
|
||||
ipList->setPlainText(ips);
|
||||
LOAD_FLAG_END
|
||||
}
|
||||
@ -410,7 +410,7 @@ void RouteEditor::on_routeProtocolHTTPCB_stateChanged(int arg1)
|
||||
if (routeProtocolBTCB->isChecked()) protocols.push_back("bittorrent");
|
||||
|
||||
CurrentRule.protocol = protocols;
|
||||
statusLabel->setText(tr("Protocol list changed: ") + Stringify(protocols));
|
||||
statusLabel->setText(tr("Protocol list changed: ") + protocols.join(";"));
|
||||
}
|
||||
void RouteEditor::on_routeProtocolTLSCB_stateChanged(int arg1)
|
||||
{
|
||||
@ -424,7 +424,7 @@ void RouteEditor::on_routeProtocolTLSCB_stateChanged(int arg1)
|
||||
if (routeProtocolBTCB->isChecked()) protocols.push_back("bittorrent");
|
||||
|
||||
CurrentRule.protocol = protocols;
|
||||
statusLabel->setText(tr("Protocol list changed: ") + Stringify(protocols));
|
||||
statusLabel->setText(tr("Protocol list changed: ") + protocols.join(";"));
|
||||
}
|
||||
void RouteEditor::on_routeProtocolBTCB_stateChanged(int arg1)
|
||||
{
|
||||
@ -438,7 +438,7 @@ void RouteEditor::on_routeProtocolBTCB_stateChanged(int arg1)
|
||||
if (routeProtocolTLSCB->isChecked()) protocols.push_back("tls");
|
||||
|
||||
CurrentRule.protocol = protocols;
|
||||
statusLabel->setText(tr("Protocol list changed: ") + Stringify(protocols));
|
||||
statusLabel->setText(tr("Protocol list changed: ") + protocols.join(";"));
|
||||
}
|
||||
void RouteEditor::on_balancerAddBtn_clicked()
|
||||
{
|
||||
|
@ -47,36 +47,6 @@ namespace Qv2ray
|
||||
return randomString;
|
||||
}
|
||||
|
||||
QString Stringify(list<string> list, QString saperator)
|
||||
{
|
||||
QString out;
|
||||
|
||||
for (auto item : list) {
|
||||
out.append(QString::fromStdString(item));
|
||||
out.append(saperator);
|
||||
}
|
||||
|
||||
if (out.length() >= 1)
|
||||
out = out.remove(out.length() - 1, 1);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
QString Stringify(QList<QString> list, QString saperator)
|
||||
{
|
||||
QString out;
|
||||
|
||||
for (auto item : list) {
|
||||
out.append(item);
|
||||
out.append(saperator);
|
||||
}
|
||||
|
||||
if (out.length() >= 1)
|
||||
out = out.remove(out.length() - 1, 1);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
QString StringFromFile(QFile *source)
|
||||
{
|
||||
source->open(QFile::ReadOnly);
|
||||
|
@ -30,8 +30,8 @@ namespace Qv2ray
|
||||
QString JsonToString(QJsonObject json, QJsonDocument::JsonFormat format = QJsonDocument::JsonFormat::Indented);
|
||||
QString JsonToString(QJsonArray array, QJsonDocument::JsonFormat format = QJsonDocument::JsonFormat::Indented);
|
||||
QString VerifyJsonString(const QString &source);
|
||||
QString Stringify(list<string> list, QString saperator = ";");
|
||||
QString Stringify(QList<QString> list, QString saperator = ";");
|
||||
//QString Stringify(list<string> list, QString saperator = ";");
|
||||
//QString Stringify(QList<QString> list, QString saperator = ";");
|
||||
QString FormatBytes(long long bytes);
|
||||
void DeducePossibleFileName(const QString &baseDir, QString *fileName, const QString &extension);
|
||||
QString ConvertGFWToPAC(const QString &rawContent, const QString &customProxyString);
|
||||
|
Loading…
Reference in New Issue
Block a user