[fix] fixed API empty tag error #121

This commit is contained in:
Leroy.H.Y 2019-11-27 16:10:05 +08:00
parent 48f57f3c4c
commit a582cc7525
No known key found for this signature in database
GPG Key ID: 6AC1673B587DC37D
3 changed files with 9 additions and 2 deletions

View File

@ -1 +1 @@
931 934

View File

@ -217,10 +217,14 @@ int main(int argc, char *argv[])
} }
auto confObject = StructFromJsonString<Qv2rayConfig>(JsonToString(conf)); auto confObject = StructFromJsonString<Qv2rayConfig>(JsonToString(conf));
SetGlobalConfig(confObject);
qApp->removeTranslator(getTranslator(_lang)); qApp->removeTranslator(getTranslator(_lang));
LOG(MODULE_INIT, "Removing system translations") LOG(MODULE_INIT, "Removing system translations")
if (confObject.uiConfig.language.empty()) {
LOG(MODULE_UI, "Setting default UI language to en-US")
confObject.uiConfig.language = "en-US";
}
if (qApp->installTranslator(getTranslator(QSTRING(confObject.uiConfig.language)))) { if (qApp->installTranslator(getTranslator(QSTRING(confObject.uiConfig.language)))) {
LOG(MODULE_INIT, "Loaded Translator " + confObject.uiConfig.language) LOG(MODULE_INIT, "Loaded Translator " + confObject.uiConfig.language)
} else { } else {
@ -232,6 +236,7 @@ int main(int argc, char *argv[])
"https://github.com/lhy0403/Qv2ray/issues/new"); "https://github.com/lhy0403/Qv2ray/issues/new");
} }
SetGlobalConfig(confObject);
auto osslReqVersion = QSslSocket::sslLibraryBuildVersionString().toStdString(); auto osslReqVersion = QSslSocket::sslLibraryBuildVersionString().toStdString();
auto osslCurVersion = QSslSocket::sslLibraryVersionString().toStdString(); auto osslCurVersion = QSslSocket::sslLibraryVersionString().toStdString();
LOG(MODULE_NETWORK, "Current OpenSSL version: " + osslCurVersion) LOG(MODULE_NETWORK, "Current OpenSSL version: " + osslCurVersion)

View File

@ -823,6 +823,8 @@ void MainWindow::timerEvent(QTimerEvent *event)
foreach (auto inbound, inbounds) { foreach (auto inbound, inbounds) {
auto tag = inbound.toObject()["tag"].toString(); auto tag = inbound.toObject()["tag"].toString();
if (tag.isEmpty()) continue;
// TODO: A proper scheme... // TODO: A proper scheme...
if (tag == QV2RAY_API_TAG_INBOUND) { if (tag == QV2RAY_API_TAG_INBOUND) {
continue; continue;